Suite cursor. More...
#include <StormByte/safe/iterable.hxx>
Public Types | |
| using | iterator_category = std::conditional_t<random_access, std::random_access_iterator_tag, std::bidirectional_iterator_tag> |
| Iterator category. | |
| using | iterator_concept = iterator_category |
| C++20 iterator concept. | |
| using | value_type = typename Iterable::value_type |
| Element type. | |
| using | difference_type = std::ptrdiff_t |
| Cursor distance type. | |
| using | reference = decltype(*std::declval<Inner>()) |
| Element reference. | |
| using | pointer = void |
| The cursor does not expose a raw component pointer. | |
Public Member Functions | |
| BasicIterator ()=default | |
| Construct a singular cursor. | |
| template<bool OtherConst> requires IsConst | |
| &&!OtherConst | BasicIterator (const BasicIterator< OtherConst > &other) noexcept |
| Convert a mutable cursor to a read-only cursor. | |
| reference | operator* () const |
| Return the current element. | |
| BasicIterator & | operator++ () |
| Advance one element. | |
| BasicIterator | operator++ (int) |
| Advance one element. | |
| BasicIterator & | operator-- () |
| Move to the previous element. | |
| BasicIterator | operator-- (int) |
| Move to the previous element. | |
| BasicIterator & | operator+= (difference_type offset) |
| Advance by an offset. | |
| BasicIterator & | operator-= (difference_type offset) |
| Retreat by an offset. | |
| reference | operator[] (difference_type offset) const |
| Return the element at an offset. | |
| BasicIterator | operator+ (difference_type offset) const |
| Return the cursor advanced by an offset. | |
| BasicIterator | operator- (difference_type offset) const |
| Return the cursor retreated by an offset. | |
| template<bool OtherConst> requires random_access | |
| difference_type | operator- (const BasicIterator< OtherConst > &other) const |
| Return the distance to another cursor. | |
| template<bool OtherConst> | |
| bool | operator== (const BasicIterator< OtherConst > &other) const |
| Compare cursor position. | |
| template<bool OtherConst> requires random_access | |
| bool | operator< (const BasicIterator< OtherConst > &other) const |
| Order two cursors. | |
| template<bool OtherConst> requires random_access | |
| bool | operator> (const BasicIterator< OtherConst > &other) const |
| Order two cursors. | |
| template<bool OtherConst> requires random_access | |
| bool | operator<= (const BasicIterator< OtherConst > &other) const |
| Order two cursors. | |
| template<bool OtherConst> requires random_access | |
| bool | operator>= (const BasicIterator< OtherConst > &other) const |
| Order two cursors. | |
Friends | |
| class | Iterable |
| template<bool> | |
| class | BasicIterator |
| BasicIterator | operator+ (difference_type offset, const BasicIterator &cursor) |
| Advance a cursor from the offset. | |
Suite cursor.
The category follows the wrapped component.
| IsConst | Whether dereference is read-only. |
| using StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::difference_type = std::ptrdiff_t |
Cursor distance type.
| using StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::iterator_category = std::conditional_t<random_access, std::random_access_iterator_tag, std::bidirectional_iterator_tag> |
Iterator category.
| using StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::iterator_concept = iterator_category |
C++20 iterator concept.
| using StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::pointer = void |
The cursor does not expose a raw component pointer.
| using StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::reference = decltype(*std::declval<Inner>()) |
Element reference.
| using StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::value_type = typename Iterable::value_type |
Element type.
|
default |
Construct a singular cursor.
|
noexcept |
Convert a mutable cursor to a read-only cursor.
| other | Mutable cursor. |
| reference StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator* | ( | ) | const |
Return the current element.
| BasicIterator StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator+ | ( | difference_type | offset | ) | const |
Return the cursor advanced by an offset.
Random-access components only.
| offset | Element offset. |
| BasicIterator & StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator++ | ( | ) |
Advance one element.
| BasicIterator StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator++ | ( | int | ) |
Advance one element.
| BasicIterator & StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator+= | ( | difference_type | offset | ) |
Advance by an offset.
Random-access components only.
| offset | Element offset. |
| difference_type StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator- | ( | const BasicIterator< OtherConst > & | other | ) | const |
Return the distance to another cursor.
Random-access components only.
| other | Cursor to measure against. |
| BasicIterator StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator- | ( | difference_type | offset | ) | const |
Return the cursor retreated by an offset.
Random-access components only.
| offset | Element offset. |
| BasicIterator & StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator-- | ( | ) |
Move to the previous element.
| BasicIterator StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator-- | ( | int | ) |
Move to the previous element.
| BasicIterator & StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator-= | ( | difference_type | offset | ) |
Retreat by an offset.
Random-access components only.
| offset | Element offset. |
| bool StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator< | ( | const BasicIterator< OtherConst > & | other | ) | const |
Order two cursors.
Random-access components only.
| other | Cursor to compare. |
other. | bool StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator<= | ( | const BasicIterator< OtherConst > & | other | ) | const |
Order two cursors.
Random-access components only.
| other | Cursor to compare. |
other. | bool StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator== | ( | const BasicIterator< OtherConst > & | other | ) | const |
Compare cursor position.
| other | Cursor to compare. |
| bool StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator> | ( | const BasicIterator< OtherConst > & | other | ) | const |
Order two cursors.
Random-access components only.
| other | Cursor to compare. |
other. | bool StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator>= | ( | const BasicIterator< OtherConst > & | other | ) | const |
Order two cursors.
Random-access components only.
| other | Cursor to compare. |
other. | reference StormByte::Safe::Iterable< Component >::BasicIterator< IsConst >::operator[] | ( | difference_type | offset | ) | const |
Return the element at an offset.
Random-access components only.
| offset | Element offset. |
|
friend |
|
friend |
|
friend |
Advance a cursor from the offset.
Required by random_access_iterator.
| offset | Element offset. |
| cursor | Cursor to advance. |