reverse_iterator

namespace opentl {
    template <typename It>
    class reverse_iterator;
}

An iterator that reverses the direction of another iterator.

Template Parameters

Name Description
It The iterator type.

Member Types

Type Description
iterator_type The iterator type.
difference_type The difference type.

Member Functions

Name Return Type Description
reverse_iterator()   reverse_iterator constructor.
reverse_iterator(iterator_type)   reverse_iterator constructor.
base() iterator_type Returns the underlying iterator.
operator*() decltype(auto) Dereferences the underlying iterator and returns a reference to the value.
operator++() reverse_iterator& Increments the iterator and returns a reference to it.
operator++(int) reverse_iterator Increments the iterator and returns a copy of the previous iterator.
operator--() reverse_iterator& Decrements the iterator and returns a reference to it.
operator--(int) reverse_iterator Decrements the iterator and returns a copy of the previous iterator.
operator+=(difference_type) reverse_iterator& Advances the iterator by n and returns a reference to it.
operator-=(difference_type) reverse_iterator& Backtracks the iterator by n and returns a reference to it.
operator[](difference_type) decltype(auto) Dereferences the element n positions back and returns a reference to it.

Non-member Functions

Name Return Type Description
operator+(it, n) reverse_iterator Returns a copy of the iterator advanced by n.
operator-(it, n) reverse_iterator Returns a copy of the iterator backtracked by n.
operator+(n, it) reverse_iterator Returns a copy of the iterator advanced by n.
operator-(lhs, rhs) ptrdiff_t Returns the number of positions between two reverse iterators.
operator== bool Checks if two reverse iterators refer to the same position.
operator<=> auto Orders two reverse iterators by their reversed position.