40 #ifndef SRC_LIB_ITER_INDEX_H 41 #define SRC_LIB_ITER_INDEX_H 54 template<
typename PTR>
60 using ResVal = decltype(data_->operator[](0));
63 using reference =
typename meta::RefTraits<ResVal>::Reference;
70 return isValidIDX(idx_);
76 return (*data_)[idx_];
87 isValidIDX (
size_t idx)
const 90 and idx < data_->size();
96 return c1.data_ == c2.data_ and (not c1.data_ or c1.idx_ == c2.idx_);
100 return not (c1 == c2);
120 template<
class CON,
typename PTR = CON*>
122 :
public iter::IndexAccessCore<PTR>::IterWrapper
124 using _Cor = iter::IndexAccessCore<PTR>;
125 using _Par =
typename _Cor::IterWrapper;
131 : _Par{_Cor{pContainer, 0}}
138 _Par::__throw_if_empty();
139 return _Par::stateCore().idx_;
143 setIDX (
size_t newIDX)
145 auto& core = _Par::stateCore();
146 if (not core.isValidIDX (newIDX))
148 lumiera::error::LUMIERA_ERROR_INDEX_BOUNDS);
Representation of the result of some operation, EITHER a value or a failure.
Helper template(s) for creating Lumiera Forward Iterators.
Subscript-index based access to a container, packaged as iterator.
Implementation namespace for support and library code.
Derived specific exceptions within Lumiera's exception hierarchy.
Another Lumiera Forward Iterator building block, based on incorporating a state type right into the i...
Implementation of a »IterStateCore« to access the container through an embedded index variable...