Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
make maybe_iterator constructor private
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Jan 5, 2013
1 parent 396f9ff commit 62faf9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions maybe.hh
Expand Up @@ -7,13 +7,13 @@
#include <type_traits>
#include <utility>

template<typename T> struct maybe;

template<typename T>
struct maybe_iterator {
typedef typename std::remove_pointer<T>::type value_type;
typedef T pointer;

constexpr maybe_iterator(T p) noexcept : ptr(p) {}

typename std::enable_if<!std::is_const<value_type>::value, value_type>::type
&operator*() noexcept { return *ptr; }

Expand All @@ -39,7 +39,9 @@ struct maybe_iterator {
}

private:
constexpr maybe_iterator(T p) noexcept : ptr(p) {}
T ptr;
friend maybe<value_type>;
};

template<typename T>
Expand Down

0 comments on commit 62faf9e

Please sign in to comment.