30 #ifndef SRC_LIB_ITER_CURSOR_H 31 #define SRC_LIB_ITER_CURSOR_H 37 #include <type_traits> 51 bool backwards_{
false};
59 using pointer =
typename meta::ValueTypeBinding<IT>::pointer;
60 using reference =
typename meta::ValueTypeBinding<IT>::reference;
61 using value_type =
typename std::remove_reference<reference>::type;
71 : start_(std::forward<IT>(begin))
72 , end_(std::forward<IT>(end))
80 reverse(
bool backwards)
82 if (backwards != backwards_) reverse();
88 if (start_ == end_)
return;
91 if (pos_ != start_) --pos_;
96 if (pos_ != end_) ++pos_;
106 return backwards_? pos_ != start_
113 return backwards_? *(pos_-1)
130 return (not g1.checkPoint() and not g2.checkPoint())
131 or ( g1.pos_ == g2.pos_
132 and g1.backwards_ == g2.backwards_
133 and g1.start_ == g2.start_
134 and g1.end_ == g2.end_
160 using _Core = iter::CursorGear<IT>;
174 :
_Parent(_Core(container.begin(), container.end()))
178 :
_Parent(_Core(std::forward<IT>(begin), std::forward<IT>(end)))
192 this->stateCore().reverse();
199 this->stateCore().reverse(
false);
206 this->stateCore().reverse(
true);
Helper template(s) for creating Lumiera Forward Iterators.
IterCursor & switchDir()
change the orientation of iteration.
Implementation namespace for support and library code.
Another Lumiera Forward Iterator building block, based on incorporating a state type as »*State Core*...
A cursor-like iterator with the ability to switch iteration direction.
typename std::remove_reference< reference >::type value_type
Lumiera error handling (C++ interface).