|
RPNX::DataStructures
Header-only C++ data structures and supporting utilities.
|
Random-access iterator over the segmented logical sequence. More...
#include <segmented_dynar.hpp>
Public Types | |
| using | iterator_category = std::random_access_iterator_tag |
| Iterator category for legacy algorithms. | |
| using | difference_type = std::ptrdiff_t |
| Signed iterator-distance type. | |
| using | value_type = T |
| Iterated element type. | |
| using | pointer = std::conditional_t< Const, T const*, T* > |
| Mutable or immutable element pointer type. | |
| using | reference = std::conditional_t< Const, T const&, T& > |
| Mutable or immutable element reference type. | |
| using | container_ptr = std::conditional_t< Const, const segmented_dynar*, segmented_dynar* > |
| Pointer to the mutable or immutable owning container. | |
Public Member Functions | |
| iterator_impl ()=default | |
| Constructs a singular iterator. | |
| iterator_impl (container_ptr container, std::size_t index) | |
| Constructs an iterator at a logical index. | |
| template<bool Const2, typename = std::enable_if_t< Const && !Const2 >> | |
| iterator_impl (const iterator_impl< Const2 > &other) | |
| Converts a mutable iterator to an immutable iterator. | |
| reference | operator* () const |
| Dereferences the current position. | |
| pointer | operator-> () const |
| Accesses the current element. | |
| iterator_impl & | operator++ () |
| Advances one element. | |
| iterator_impl | operator++ (int) |
| Advances one element. | |
| iterator_impl & | operator-- () |
| Retreats one element. | |
| iterator_impl | operator-- (int) |
| Retreats one element. | |
| iterator_impl & | operator+= (difference_type n) |
| Moves by a signed offset. | |
| iterator_impl & | operator-= (difference_type n) |
| Moves backward by a signed offset. | |
| iterator_impl | operator+ (difference_type n) const |
| Returns an iterator moved by an offset. | |
| iterator_impl | operator- (difference_type n) const |
| Returns an iterator moved backward by an offset. | |
| difference_type | operator- (const iterator_impl< true > &other) const |
| Computes distance from an immutable iterator. | |
| difference_type | operator- (const iterator_impl< false > &other) const |
| Computes distance from a mutable iterator. | |
| reference | operator[] (difference_type n) const |
| Dereferences an offset position. | |
| bool | operator== (const iterator_impl< true > &other) const |
| Compares with an immutable iterator for equality. | |
| bool | operator== (const iterator_impl< false > &other) const |
| Compares with a mutable iterator for equality. | |
| bool | operator!= (const iterator_impl< true > &other) const |
| Compares with an immutable iterator for inequality. | |
| bool | operator!= (const iterator_impl< false > &other) const |
| Compares with a mutable iterator for inequality. | |
| bool | operator< (const iterator_impl< true > &other) const |
| Tests whether this index precedes an immutable iterator. | |
| bool | operator< (const iterator_impl< false > &other) const |
| Tests whether this index precedes a mutable iterator. | |
| bool | operator> (const iterator_impl< true > &other) const |
| Tests whether this index follows an immutable iterator. | |
| bool | operator> (const iterator_impl< false > &other) const |
| Tests whether this index follows a mutable iterator. | |
| bool | operator<= (const iterator_impl< true > &other) const |
| Tests whether this index does not follow an immutable iterator. | |
| bool | operator<= (const iterator_impl< false > &other) const |
| Tests whether this index does not follow a mutable iterator. | |
| bool | operator>= (const iterator_impl< true > &other) const |
| Tests whether this index does not precede an immutable iterator. | |
| bool | operator>= (const iterator_impl< false > &other) const |
| Tests whether this index does not precede a mutable iterator. | |
Friends | |
| class | segmented_dynar |
Random-access iterator over the segmented logical sequence.
| Const | Whether dereference yields an immutable reference. |
The iterator is non-owning. It caches the current segment while using a global logical index for comparison and cross-segment movement.
|
inline |
Constructs an iterator at a logical index.
| container | Container to reference. |
| index | Index in [0, container->size()]. |
|
inline |
Converts a mutable iterator to an immutable iterator.
| Const2 | Source constness, required to be false. |
| other | Mutable iterator to copy. |
|
inline |
Compares with a mutable iterator for inequality.
| other | Iterator in the same container. |
|
inline |
Compares with an immutable iterator for inequality.
| other | Iterator in the same container. |
|
inline |
Dereferences the current position.
|
inline |
Returns an iterator moved by an offset.
| n | Offset in elements. |
|
inline |
|
inline |
Advances one element.
end().
|
inline |
Moves by a signed offset.
| n | Offset in elements. |
|
inline |
Computes distance from a mutable iterator.
| other | Iterator in the same container. |
|
inline |
Computes distance from an immutable iterator.
| other | Iterator in the same container. |
|
inline |
Returns an iterator moved backward by an offset.
| n | Offset in elements. |
|
inline |
Retreats one element.
begin().
|
inline |
Retreats one element.
begin().
|
inline |
Moves backward by a signed offset.
| n | Offset in elements. |
|
inline |
Accesses the current element.
|
inline |
Tests whether this index precedes a mutable iterator.
| other | Iterator in the same container. |
|
inline |
Tests whether this index precedes an immutable iterator.
| other | Iterator in the same container. |
|
inline |
Tests whether this index does not follow a mutable iterator.
| other | Iterator in the same container. |
|
inline |
Tests whether this index does not follow an immutable iterator.
| other | Iterator in the same container. |
|
inline |
Compares with a mutable iterator for equality.
| other | Iterator in the same container. |
|
inline |
Compares with an immutable iterator for equality.
| other | Iterator in the same container. |
|
inline |
Tests whether this index follows a mutable iterator.
| other | Iterator in the same container. |
|
inline |
Tests whether this index follows an immutable iterator.
| other | Iterator in the same container. |
|
inline |
Tests whether this index does not precede a mutable iterator.
| other | Iterator in the same container. |
|
inline |
Tests whether this index does not precede an immutable iterator.
| other | Iterator in the same container. |
|
inline |
Dereferences an offset position.
| n | Offset from this iterator. |