20 #include <paludis/util/enum_iterator-fwd.hh> 21 #include <paludis/util/operators.hh> 24 #ifndef PALUDIS_GUARD_PALUDIS_UTIL_ENUM_ITERATOR_HH 25 #define PALUDIS_GUARD_PALUDIS_UTIL_ENUM_ITERATOR_HH 1 35 template <
typename E_>
37 public relational_operators::HasRelationalOperators
47 _value(static_cast<E_>(0))
51 EnumIterator(
const EnumIterator & other) :
56 explicit EnumIterator(
const E_ e) :
62 EnumIterator & operator= (
const EnumIterator & other)
64 _value = other._value;
73 typedef E_ & value_type;
75 typedef E_ & reference;
76 typedef const E_ & const_reference;
79 typedef const E_ * const_pointer;
81 typedef std::ptrdiff_t difference_type;
82 typedef std::forward_iterator_tag iterator_category;
89 EnumIterator & operator++ ()
91 _value =
static_cast<E_
>(_value + 1);
95 EnumIterator operator++ (
int)
97 EnumIterator result(*
this);
107 pointer operator-> ()
112 reference operator* ()
117 const_pointer operator-> ()
const 122 const_reference operator* ()
const 131 bool operator== (
const EnumIterator & other)
const 133 return **
this == *other;
136 bool operator< (
const EnumIterator & other)
const 138 return **
this < *other;
144 template <
typename E_>
145 EnumIterator<E_> enum_iterator(
const E_ e)
147 return EnumIterator<E_>(e);
Definition: about_metadata-fwd.hh:23