27 #ifndef MLN_CORE_CONCEPT_ITERATOR_HH
28 # define MLN_CORE_CONCEPT_ITERATOR_HH
34 # include <mln/core/concept/object.hh>
39 # define for_all(x) for(x.start(); x.is_valid(); x.next())
45 # define for_all_2(x1, x2) \
46 for(x1.start(), x2.start(); \
54 # define for_all_3(x1, x2, x3) \
55 for(x1.start(), x2.start(), x3.start(); \
57 x1.next(), x2.next(), x3.next())
63 # define for_all_remaining(x) \
64 if (! x.is_valid()) {} else while (x.next(), x.is_valid())
99 # ifndef MLN_INCLUDE_ONLY
101 template <
typename E>
104 assert(
exact(
this)->is_valid());
105 exact(
this)->next_();
108 template <
typename E>
112 bool (E::*m1)()
const = & E::is_valid;
114 void (E::*m2)() = & E::invalidate;
116 void (E::*m3)() = & E::start;
118 void (E::*m4)() = & E::next_;
122 # endif // ! MLN_INCLUDE_ONLY
128 #endif // ! MLN_CORE_CONCEPT_ITERATOR_HH