tetl 0.1.0
Embedded Template Library
|
reverse_iterator is an iterator adaptor that reverses the direction of a given iterator. In other words, when provided with a bidirectional iterator, reverse_iterator
produces a new iterator that moves from the end to the beginning of the sequence defined by the underlying bidirectional iterator. This is the iterator returned by member functions rbegin()
and rend()
of the standard library containers.
More...
#include <reverse_iterator.hpp>
Public Types | |
using | difference_type = typename etl::iterator_traits< Iter >::difference_type |
using | iterator_category = typename etl::iterator_traits< Iter >::iterator_category |
using | iterator_type = Iter |
using | pointer = typename etl::iterator_traits< Iter >::pointer |
using | reference = typename etl::iterator_traits< Iter >::reference |
using | value_type = typename iterator_traits< Iter >::value_type |
Public Member Functions | |
constexpr | reverse_iterator () |
Constructs a new iterator adaptor. | |
constexpr | reverse_iterator (Iter x) |
Constructs a new iterator adaptor. | |
template<typename Other > | |
constexpr | reverse_iterator (reverse_iterator< Other > const &other) |
Constructs a new iterator adaptor. | |
constexpr auto | base () const -> Iter |
Returns the underlying base iterator. | |
constexpr auto | operator* () const -> reference |
Returns a reference to the element previous to current. | |
constexpr auto | operator+ (difference_type n) const -> reverse_iterator |
Returns an iterator which is advanced by n positions. | |
constexpr auto | operator++ () -> reverse_iterator & |
Pre-increments by one respectively. | |
constexpr auto | operator++ (int) -> reverse_iterator |
Pre-increments by one respectively. | |
constexpr auto | operator+= (difference_type n) -> reverse_iterator & |
Advances the iterator by n or -n positions respectively. | |
constexpr auto | operator- (difference_type n) const -> reverse_iterator |
Returns an iterator which is advanced by -n positions. | |
constexpr auto | operator-- () -> reverse_iterator & |
Pre-decrements by one respectively. | |
constexpr auto | operator-- (int) -> reverse_iterator |
Pre-decrements by one respectively. | |
constexpr auto | operator-= (difference_type n) -> reverse_iterator & |
Advances the iterator by n or -n positions respectively. | |
constexpr auto | operator-> () const -> pointer |
Returns a pointer to the element previous to current. | |
template<typename Other > | |
constexpr auto | operator= (reverse_iterator< Other > const &other) -> reverse_iterator & |
The underlying iterator is assigned the value of the underlying iterator of other, i.e. other.base(). | |
constexpr auto | operator[] (difference_type n) const -> reference |
Returns a reference to the element at specified relative location. | |
reverse_iterator is an iterator adaptor that reverses the direction of a given iterator. In other words, when provided with a bidirectional iterator, reverse_iterator
produces a new iterator that moves from the end to the beginning of the sequence defined by the underlying bidirectional iterator. This is the iterator returned by member functions rbegin()
and rend()
of the standard library containers.
using difference_type = typename etl::iterator_traits<Iter>::difference_type |
using iterator_category = typename etl::iterator_traits<Iter>::iterator_category |
using value_type = typename iterator_traits<Iter>::value_type |
|
inlineconstexpr |
Constructs a new iterator adaptor.
Default constructor. The underlying iterator is value-initialized. Operations on the resulting iterator have defined behavior if and only if the corresponding operations on a value-initialized Iterator also have defined behavior.
|
inlineexplicitconstexpr |
Constructs a new iterator adaptor.
The underlying iterator is initialized with x.
|
inlineconstexpr |
Constructs a new iterator adaptor.
The underlying iterator is initialized with that of other.
Returns the underlying base iterator.
Returns a reference to the element previous to current.
|
inlineconstexpr |
Returns an iterator which is advanced by n positions.
Pre-increments by one respectively.
Pre-increments by one respectively.
|
inlineconstexpr |
Advances the iterator by n or -n positions respectively.
|
inlineconstexpr |
Returns an iterator which is advanced by -n positions.
Pre-decrements by one respectively.
Pre-decrements by one respectively.
|
inlineconstexpr |
Advances the iterator by n or -n positions respectively.
Returns a pointer to the element previous to current.
|
inlineconstexpr |
The underlying iterator is assigned the value of the underlying iterator of other, i.e. other.base().
|
inlineconstexpr |
Returns a reference to the element at specified relative location.