|
halcheck 1.0
|
An iterator into a random-access range that is invalidated if and only if the index of the pointed-to element changes. More...
#include <index.hpp>
Public Types | |
| using | value_type = lib::range_value_t<R> |
| The type of value this iterator points to. | |
| using | reference = lib::range_reference_t<R> |
The type of value returned by operator*. | |
| using | pointer = void |
This iterator does not support operator->. | |
| using | difference_type = lib::range_difference_t<R> |
| The type of distances between iterators. | |
| using | iterator_category = std::random_access_iterator_tag |
| Indicates that index_iterator is a random-access iterator. | |
Public Member Functions | |
| index_iterator ()=default | |
| Constructs a default index_iterator. | |
| index_iterator (R &base, difference_type index=0) | |
| Constructs an index_iterator pointing into the given range. | |
| template<typename T > | |
| index_iterator (const index_iterator< T > &other) | |
| Converts between index_iterators. | |
| reference | operator* () const |
| Obtains the element this iterator points to. | |
| index_iterator & | operator++ () |
| Advances this iterator. | |
| index_iterator & | operator-- () |
| Advances this iterator backwards. | |
| index_iterator & | operator+= (difference_type n) |
| Advances this iterator by the specified number of steps. | |
| difference_type | index () const |
| Gets the index of the element this iterator points to. | |
| constexpr lib::iter_reference_t< I > | operator[] (lib::iter_difference_t< I > n) const |
| Access the element at the specified index. | |
| I | operator++ (int) |
| Advances this iterator. | |
| I | operator-- (int) |
| Advances this iterator a step backwards. | |
| I & | operator-= (lib::iter_difference_t< I > n) |
| Advances this iterator the specified number of steps backwards. | |
Friends | |
| bool | operator== (const index_iterator &lhs, const index_iterator &rhs) |
| Determines if two iterators are equal. | |
| difference_type | operator- (const index_iterator &lhs, const index_iterator &rhs) |
| Computes the distance between two iterators. | |
An iterator into a random-access range that is invalidated if and only if the index of the pointed-to element changes.
| R | The type of range to point into. |