4.6.0
Freundlich's C++ toolkit
|
A template for implementing iterators.
This class is meant to be derived from in order to implement an iterator. It provides all functions to fulfil the iterator requirements of a specific iterator category. The derived class D
is expected to implement certain public functions depending on what the category is:
void increment()
: Increments the iterator. bool equal(D) const
: Compares two iterators for equality. Types::reference dereference() const
: Returns the current element. Types::reference
must be Types::value_type (const) &
. D
must have a default constructor. void decrement()
: Decrements the iterator. void advance(Types::difference_type)
: Moves the iterator forwards/backwards. Types::difference_type distance_to(D) const
: The value to advance *this
with in order to be equal to the argument. Types | Must be an fcppt::iterator::types. |
Public Types | |
using | derived = typename Types::derived |
using | value_type = typename Types::value_type |
using | reference = typename Types::reference |
using | difference_type = typename Types::difference_type |
using | pointer = std::add_pointer_t<reference> |
using | iterator_category = typename Types::iterator_category |
Public Member Functions | |
reference | operator* () const |
derived & | operator++ () |
bool | operator== (base const &) const |
bool | operator!= (base const &) const |
pointer | operator-> () const |
derived | operator++ (int) |
void | swap (base &) noexcept |
derived & | operator-- () |
derived | operator-- (int) |
derived & | operator+= (difference_type) |
derived | operator+ (difference_type) const |
derived & | operator-= (difference_type) |
derived | operator- (difference_type) const |
reference | operator[] (difference_type) const |
difference_type | operator- (base const &) const |
Protected Member Functions | |
base () | |
using fcppt::iterator::base< Types >::derived = typename Types::derived |
using fcppt::iterator::base< Types >::difference_type = typename Types::difference_type |
using fcppt::iterator::base< Types >::iterator_category = typename Types::iterator_category |
using fcppt::iterator::base< Types >::pointer = std::add_pointer_t<reference> |
using fcppt::iterator::base< Types >::reference = typename Types::reference |
using fcppt::iterator::base< Types >::value_type = typename Types::value_type |
|
protected |
|
nodiscard |
|
nodiscard |
|
nodiscard |
derived & fcppt::iterator::base< Types >::operator++ | ( | ) |
|
nodiscard |
derived & fcppt::iterator::base< Types >::operator+= | ( | difference_type | ) |
|
nodiscard |
|
nodiscard |
derived & fcppt::iterator::base< Types >::operator-- | ( | ) |
|
nodiscard |
derived & fcppt::iterator::base< Types >::operator-= | ( | difference_type | ) |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
noexcept |