26 #ifndef MLN_CORE_CONCEPT_ITERATOR_HH
27 # define MLN_CORE_CONCEPT_ITERATOR_HH
33 # include <mln/core/concept/object.hh>
38 # define for_all(x) for(x.start(); x.is_valid(); x.next())
44 # define for_all_2(x1, x2) \
45 for(x1.start(), x2.start(); \
53 # define for_all_3(x1, x2, x3) \
54 for(x1.start(), x2.start(), x3.start(); \
56 x1.next(), x2.next(), x3.next())
62 # define for_all_remaining(x) \
63 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