39 #ifndef SRC_LIB_ITER_CURSOR_H 40 #define SRC_LIB_ITER_CURSOR_H 46 #include <type_traits> 60 bool backwards_{
false};
68 using pointer =
typename meta::ValueTypeBinding<IT>::pointer;
69 using reference =
typename meta::ValueTypeBinding<IT>::reference;
70 using value_type =
typename std::remove_reference<reference>::type;
80 : start_(std::forward<IT>(begin))
81 , end_(std::forward<IT>(end))
89 reverse(
bool backwards)
91 if (backwards != backwards_) reverse();
97 if (start_ == end_)
return;
100 if (pos_ != start_) --pos_;
105 if (pos_ != end_) ++pos_;
115 return backwards_? pos_ != start_
122 return backwards_? *(pos_-1)
139 return (not g1.checkPoint() and not g2.checkPoint())
140 or ( g1.pos_ == g2.pos_
141 and g1.backwards_ == g2.backwards_
142 and g1.start_ == g2.start_
143 and g1.end_ == g2.end_
167 :
public IterStateWrapper<typename iter::CursorGear<IT>::value_type, iter::CursorGear<IT>>
169 using _Core = iter::CursorGear<IT>;
183 :
_Parent(_Core(container.begin(), container.end()))
187 :
_Parent(_Core(std::forward<IT>(begin), std::forward<IT>(end)))
201 this->stateCore().reverse();
208 this->stateCore().reverse(
false);
215 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 right into the i...
A cursor-like iterator with the ability to switch iteration direction.
typename std::remove_reference< reference >::type value_type
Lumiera error handling (C++ interface).