|
RPNX::DataStructures
Header-only C++ data structures and supporting utilities.
|
Forward iterator adapter that checks access against an end sentinel. More...
#include <iterator.hpp>
Public Member Functions | |
| bounded_iterator ()=default | |
| Constructs a value-initialized iterator and sentinel. | |
| constexpr | bounded_iterator (It current, It last) |
| Constructs an adapter for a current position and end sentinel. | |
| constexpr reference | operator* () const |
| Dereferences the current position. | |
| constexpr pointer | operator-> () const |
| Accesses the current element. | |
| constexpr bounded_iterator & | operator++ () |
| Advances to the next position. | |
| constexpr bounded_iterator | operator++ (int) |
| Advances to the next position. | |
| constexpr bool | operator== (const bounded_iterator &rhs) const |
| Compares current positions. | |
| constexpr bool | operator!= (const bounded_iterator &rhs) const |
| Compares current positions for inequality. | |
Forward iterator adapter that checks access against an end sentinel.
The adapter turns dereferencing or incrementing an end iterator into a deterministic std::out_of_range exception. The wrapped iterator and sentinel must belong to the same underlying range and must outlive this non-owning adapter.
| It | Forward iterator type to wrap. |
|
inlineconstexpr |
Constructs an adapter for a current position and end sentinel.
| current | Current iterator position. |
| last | End sentinel for the same range. |
|
inlineconstexpr |
Compares current positions for inequality.
| rhs | Iterator to compare. |
|
inlineconstexpr |
Dereferences the current position.
| std::out_of_range | if positioned at the end sentinel. |
|
inlineconstexpr |
Advances to the next position.
| std::out_of_range | if already at the end sentinel. |
|
inlineconstexpr |
Advances to the next position.
| std::out_of_range | if already at the end sentinel. |
|
inlineconstexpr |
Accesses the current element.
| std::out_of_range | if positioned at the end sentinel. |
|
inlineconstexpr |
Compares current positions.
| rhs | Iterator to compare. |
true when both wrap equal current iterators.