|
template<class I = Iter, std::enable_if_t< std::is_default_constructible_v< I >, bool > = true> |
constexpr | IndexedIterator () noexcept(std::is_nothrow_default_constructible_v< Iter >) |
| Default constructor default-constructs the Iter base type and the index by 0.
|
|
constexpr | IndexedIterator (Iter it, size_type index=0) noexcept(std::is_nothrow_copy_constructible_v< Iter >) |
|
constexpr size_type | index () const noexcept |
| Return the enumeration index.
|
|
constexpr IndexedIterator & | operator++ () |
| Increment the iterator and the index.
|
|
constexpr IndexedIterator | operator++ (int) |
| Increment the iterator and the index.
|
|
template<class I = Iter, decltype(--std::declval< I & >(), bool{}) = true> |
constexpr IndexedIterator & | operator-- () |
| Decrement the iterator and the index.
|
|
template<class I = Iter, decltype(std::declval< I & >() --, bool{}) = true> |
constexpr IndexedIterator | operator-- (int) |
| Decrement the iterator and the index.
|
|
template<class I = Iter, decltype(std::declval< I & >()+=1, bool{}) = true> |
constexpr IndexedIterator & | operator+= (typename Iter::difference_type n) |
| Increment the iterator and the index.
|
|
template<class I = Iter, decltype(std::declval< I & >() -=1, bool{}) = true> |
constexpr IndexedIterator & | operator-= (typename Iter::difference_type n) |
| Decrement the iterator and the index.
|
|
template<class Iter>
class Dune::IndexedIterator< Iter >
An iterator mixin that adds an index()
method returning an enumeration index for the traversal.
This is a mixin class that derives from its template parameter Iter
and adds the method index()
to retrieve an enumeration index during traversal. Only the increment and decrement operators are adapted to also increment (decrement) the accompanying index in the same way the iterator is incremented or decremented. Especially the dereference and comparison operators are not modified by this mixin class.
- Template Parameters
-