Standard C++ Library Reference ISO/IEC (VERSION3)
};
The template class describes an object that behaves like a random-access iterator, only in reverse. It
stores a random-access iterator of type RanIt in the protected object current. Incrementing the
object X of type reverse_iterator decrements X.current, and decrementing x increments
X.current. Moreover, the expression *X evaluates to *(current - 1), of type reference.
Typically, reference is type Tr&.
Thus, you can use an object of class reverse_iterator to access in reverse order a sequence that
is traversed in order by a random-access iterator.
Several STL containers specialize reverse_iterator for RanIt a bidirectional iterator. In these
cases, you must not call any of the member functions operator+=, operator+, operator-=,
operator-, or operator[].
reverse_iterator::base
RanIt base() const;
The member function returns current.
reverse_iterator::difference_type
typedef typename iterator_traits<RanIt>::difference_type
difference_type;
The type is a synonym for the iterator trait typename
iterator_traits<RanIt>::pointer.
reverse_iterator::iterator_type
typedef RanIt iterator_type;
The type is a synonym for the template parameter RanIt.
reverse_iterator::operator*
reference operator*() const;
The operator returns *(current - 1).
reverse_iterator::operator+
reverse_iterator operator+(difference_type off) const;
The operator returns reverse_iterator(*this) += off.