|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
STL-compatible mutable iterator adapter for Aleph containers. More...
#include <ah-iterator.H>
Public Types | |
| using | T = typename SetType::Item_Type |
| using | Itor = typename SetType::Iterator |
| using | iterator_category = std::conditional_t< AlephRandomAccessItor< Itor >, std::random_access_iterator_tag, std::forward_iterator_tag > |
| Category is promoted to random-access when the underlying Aleph iterator opts in (see AlephRandomAccessItor); otherwise it stays forward, which is the historical default and never a regression. | |
| using | iterator_concept = iterator_category |
| using | difference_type = std::ptrdiff_t |
| using | reference = decltype(std::declval< const Itor & >().get_curr()) |
| using | pointer = std::add_pointer_t< std::remove_reference_t< reference > > |
| using | value_type = T |
Public Member Functions | |
| StlIterator () noexcept=default | |
| Default constructor creates an "end" iterator (no current element). | |
| StlIterator & | operator++ () |
| Pre-increment: advance to the next element. | |
| StlIterator | operator++ (int) |
| Post-increment: advance to the next element and return the old iterator. | |
| bool | operator== (const StlIterator &it) const |
| Equality compares positions when both iterators are valid; otherwise both must be in the end state. | |
| bool | operator!= (const StlIterator &it) const |
| Inequality. | |
| reference | operator* () const |
| Dereference: return the current element. | |
| pointer | operator-> () const |
| Member access to the current element. | |
| StlIterator & | operator-- () |
| Pre-decrement: move to the previous element. | |
| StlIterator | operator-- (int) |
| Post-decrement: move to the previous element and return the old iterator. | |
| StlIterator & | operator+= (difference_type n) |
Advance the iterator n positions (n may be negative). | |
| StlIterator & | operator-= (difference_type n) |
Move the iterator back n positions (n may be negative). | |
| StlIterator | operator+ (difference_type n) const |
Return an iterator advanced n positions. | |
| StlIterator | operator- (difference_type n) const |
Return an iterator moved back n positions. | |
| difference_type | operator- (const StlIterator &it) const |
| Return the signed distance between two iterators. | |
| reference | operator[] (difference_type n) const |
Access the element n positions away from the current one. | |
| std::strong_ordering | operator<=> (const StlIterator &it) const |
| Order two iterators by their logical position. | |
Static Public Member Functions | |
| static StlIterator | begin (SetType &s) |
| Create an iterator positioned at the first element of the container. | |
| static StlIterator | end (SetType &s) |
| Create an end iterator for the container. | |
Friends | |
| StlIterator | operator+ (difference_type n, const StlIterator &it) |
Return an iterator advanced n positions (symmetric form). | |
STL-compatible mutable iterator adapter for Aleph containers.
This adapter wraps an Aleph-style iterator (SetType::Iterator) and exposes the operations expected by the STL and C++20 ranges.
| SetType | Aleph container type. |
SetType::Iterator:SetType&.bool has_curr() const.void next().auto & get_curr() const returning the current element.auto get_pos() const returning a position that is stable and comparable between iterators over the same container.void end() to move the iterator to the end sentinel. Definition at line 98 of file ah-iterator.H.
| using StlIterator< SetType >::difference_type = std::ptrdiff_t |
Definition at line 110 of file ah-iterator.H.
| using StlIterator< SetType >::iterator_category = std::conditional_t<AlephRandomAccessItor<Itor>, std::random_access_iterator_tag, std::forward_iterator_tag> |
Category is promoted to random-access when the underlying Aleph iterator opts in (see AlephRandomAccessItor); otherwise it stays forward, which is the historical default and never a regression.
Definition at line 106 of file ah-iterator.H.
| using StlIterator< SetType >::iterator_concept = iterator_category |
Definition at line 108 of file ah-iterator.H.
| using StlIterator< SetType >::Itor = typename SetType::Iterator |
Definition at line 101 of file ah-iterator.H.
| using StlIterator< SetType >::pointer = std::add_pointer_t<std::remove_reference_t<reference> > |
Definition at line 114 of file ah-iterator.H.
| using StlIterator< SetType >::reference = decltype(std::declval<const Itor &>().get_curr()) |
Definition at line 112 of file ah-iterator.H.
| using StlIterator< SetType >::T = typename SetType::Item_Type |
Definition at line 100 of file ah-iterator.H.
| using StlIterator< SetType >::value_type = T |
Definition at line 116 of file ah-iterator.H.
|
defaultnoexcept |
Default constructor creates an "end" iterator (no current element).
Referenced by StlIterator< SetType >::begin().
|
inlinestatic |
Create an iterator positioned at the first element of the container.
Definition at line 264 of file ah-iterator.H.
References StlIterator< SetType >::StlIterator().
Referenced by StlAlephIterator< SetName >::begin().
|
inlinestatic |
Create an end iterator for the container.
Definition at line 270 of file ah-iterator.H.
Referenced by StlAlephIterator< SetName >::end().
|
inline |
Inequality.
Definition at line 158 of file ah-iterator.H.
|
inline |
Dereference: return the current element.
Definition at line 166 of file ah-iterator.H.
|
inline |
Return an iterator advanced n positions.
Definition at line 216 of file ah-iterator.H.
|
inline |
Pre-increment: advance to the next element.
Definition at line 124 of file ah-iterator.H.
|
inline |
Post-increment: advance to the next element and return the old iterator.
Definition at line 131 of file ah-iterator.H.
|
inline |
Advance the iterator n positions (n may be negative).
Definition at line 200 of file ah-iterator.H.
|
inline |
Return the signed distance between two iterators.
Definition at line 241 of file ah-iterator.H.
|
inline |
Return an iterator moved back n positions.
Definition at line 232 of file ah-iterator.H.
|
inline |
Pre-decrement: move to the previous element.
Definition at line 183 of file ah-iterator.H.
|
inline |
Post-decrement: move to the previous element and return the old iterator.
Definition at line 191 of file ah-iterator.H.
|
inline |
Move the iterator back n positions (n may be negative).
Definition at line 208 of file ah-iterator.H.
|
inline |
Member access to the current element.
Definition at line 172 of file ah-iterator.H.
|
inline |
Order two iterators by their logical position.
Definition at line 257 of file ah-iterator.H.
|
inline |
Equality compares positions when both iterators are valid; otherwise both must be in the end state.
Definition at line 140 of file ah-iterator.H.
|
inline |
Access the element n positions away from the current one.
Definition at line 248 of file ah-iterator.H.
|
friend |
Return an iterator advanced n positions (symmetric form).
Definition at line 225 of file ah-iterator.H.