xentara-utils v2.0.4
The Xentara Utility Library
|
A wrapper around an iterator type that turns it into a fully featured contiguous iterator. More...
#include <xentara/utils/core/ContiguousIterator.hpp>
Public Types | |
using | iterator_type = Base |
The base iterator type. | |
using | value_type = typename std::iterator_traits< Base >::value_type |
The element type. | |
using | difference_type = typename std::iterator_traits< Base >::difference_type |
The type used for distances. | |
using | reference = typename std::iterator_traits< Base >::reference |
A reference to an element. | |
using | pointer = typename std::iterator_traits< Base >::pointer |
A pointer to an element. | |
using | iterator_concept = std::contiguous_iterator_tag |
The iterator concept. | |
using | iterator_category = typename std::iterator_traits< Base >::iterator_category |
The iterator category, for use in pre-C++20 code. | |
Public Member Functions | |
constexpr | ContiguousIterator () noexcept=default |
Default constructor. | |
internal constexpr | ContiguousIterator (const Base &position) noexcept |
Constructor for a specific position. | |
constexpr | ContiguousIterator (const typename Container::iterator &iterator) noexcept |
Conversion constructor for a mutable iterator belonging to the same type of container. | |
constexpr auto | operator== (const ContiguousIterator &) const -> bool=default |
Equality operator. | |
constexpr auto | operator<=> (const ContiguousIterator &) const -> std::compare_three_way_result_t< pointer >=default |
Three-Way-Comparison operator. | |
constexpr auto | operator++ () noexcept -> ContiguousIterator & |
Pre-increment operator. | |
constexpr auto | operator++ (int) noexcept -> ContiguousIterator |
Post-increment operator. | |
constexpr auto | operator-- () noexcept -> ContiguousIterator & |
Pre-decrement operator. | |
constexpr auto | operator-- (int) noexcept -> ContiguousIterator |
Post-decrement operator. | |
constexpr auto | operator+= (difference_type offset) noexcept -> ContiguousIterator & |
Addition assignment operator. | |
constexpr auto | operator-= (difference_type offset) noexcept -> ContiguousIterator & |
Subtraction assignment operator. | |
constexpr auto | operator* () const noexcept -> reference |
Indirection operator. | |
constexpr auto | operator-> () const noexcept -> pointer |
Member access operator. | |
constexpr auto | operator[] (difference_type offset) const noexcept -> reference |
Subscript operator. | |
constexpr auto | base () const noexcept -> const Base & |
Returns the base iterator. | |
A wrapper around an iterator type that turns it into a fully featured contiguous iterator.
This template can be used to turn a pointer like type into a fully fletched iterator.
Base | The base iterator type that should be wrapped. Must satisfy the named requirement LegacyContiguousIterator. |
Container | The container type the iterator belongs to, or void for a genertic iterator. If you specify a container, then the ContiguousIterator must be either Container::iterator or Container::const_iterator |
using xentara::utils::core::ContiguousIterator< Base, Container >::difference_type = typename std::iterator_traits<Base>::difference_type |
The type used for distances.
using xentara::utils::core::ContiguousIterator< Base, Container >::iterator_category = typename std::iterator_traits<Base>::iterator_category |
The iterator category, for use in pre-C++20 code.
using xentara::utils::core::ContiguousIterator< Base, Container >::iterator_concept = std::contiguous_iterator_tag |
The iterator concept.
using xentara::utils::core::ContiguousIterator< Base, Container >::iterator_type = Base |
The base iterator type.
using xentara::utils::core::ContiguousIterator< Base, Container >::pointer = typename std::iterator_traits<Base>::pointer |
A pointer to an element.
using xentara::utils::core::ContiguousIterator< Base, Container >::reference = typename std::iterator_traits<Base>::reference |
A reference to an element.
using xentara::utils::core::ContiguousIterator< Base, Container >::value_type = typename std::iterator_traits<Base>::value_type |
The element type.
|
constexprdefaultnoexcept |
Default constructor.
This constructor creates an iterator pointing to nullptr
|
explicitconstexprnoexcept |
Constructor for a specific position.
|
constexprnoexcept |
Conversion constructor for a mutable iterator belonging to the same type of container.
Creates a const iterator that points to the same position as a mutable iterator
|
constexprnoexcept |
Returns the base iterator.
|
constexprnoexcept |
Indirection operator.
|
constexprnoexcept |
Pre-increment operator.
Moves the iterator forward by one position.
|
constexprnoexcept |
Post-increment operator.
Moves the iterator forward by one position.
|
constexprnoexcept |
Addition assignment operator.
Moves the iterator forward by an offset. If the offset it negative, the iterator moves backward.
|
constexprnoexcept |
Pre-decrement operator.
Moves the iterator back by one position.
|
constexprnoexcept |
Post-decrement operator.
Moves the iterator back by one position.
|
constexprnoexcept |
Subtraction assignment operator.
Moves the iterator backward by an offset. If the offset it negative, the iterator moves forward.
|
constexprnoexcept |
Member access operator.
Gives access to a member of the object at the current position.
|
constexprdefault |
Three-Way-Comparison operator.
Compares the position of the two iterators
|
constexprdefault |
Equality operator.
Compares the position of the two iterators
|
constexprnoexcept |
Subscript operator.
Returns a reference to an object at a certain offset
offset | The offset. can be positive or negative. |