Effects: Value initializes current. Iterator operations applied to the resulting iterator have defined behavior if and only if the corresponding operations are defined on a value-initialized iterator of type Iterator.
explicit reverse_iterator(Iterator x);
Effects: Initializes current with x.
template <class U> reverse_iterator(const reverse_iterator<U> &u);
Effects: Initializes current with u.current.
template <class U>
reverse_iterator&
operator=(const reverse_iterator<U>& u);
Effects: Assigns u.base() to current.
Returns: *this.
Effects:
deref_tmp = current; --deref_tmp; return *deref_tmp;
[ Note: This operation must use an auxiliary member variable rather than a temporary variable to avoid returning a reference that persists beyond the lifetime of its associated iterator. (See [iterator.requirements].) — end note ]
reverse_iterator& operator++();
Effects: -- current;
Returns: *this.
reverse_iterator operator++(int);
Effects:
reverse_iterator tmp = *this; --current; return tmp;
reverse_iterator& operator--();
Effects: ++current
Returns: *this.
reverse_iterator operator--(int);
Effects:
reverse_iterator tmp = *this; ++current; return tmp;
reverse_iterator
operator+(typename reverse_iterator<Iterator>::difference_type n) const;
Returns: reverse_iterator(current-n).
reverse_iterator&
operator+=(typename reverse_iterator<Iterator>::difference_type n);
Effects: current -= n;
Returns: *this.
reverse_iterator
operator-(typename reverse_iterator<Iterator>::difference_type n) const;
Returns: reverse_iterator(current+n).
reverse_iterator&
operator-=(typename reverse_iterator<Iterator>::difference_type n);
Effects: current += n;
Returns: *this.
unspecified operator[](
typename reverse_iterator<Iterator>::difference_type n) const;
Returns: current[-n-1].
template <class Iterator1, class Iterator2>
bool operator==(
const reverse_iterator<Iterator1>& x,
const reverse_iterator<Iterator2>& y);
Returns: x.current == y.current.
template <class Iterator1, class Iterator2>
bool operator<(
const reverse_iterator<Iterator1>& x,
const reverse_iterator<Iterator2>& y);
Returns: x.current > y.current.
template <class Iterator1, class Iterator2>
bool operator!=(
const reverse_iterator<Iterator1>& x,
const reverse_iterator<Iterator2>& y);
Returns: x.current != y.current.
template <class Iterator1, class Iterator2>
bool operator>(
const reverse_iterator<Iterator1>& x,
const reverse_iterator<Iterator2>& y);
Returns: x.current < y.current.
template <class Iterator1, class Iterator2>
bool operator>=(
const reverse_iterator<Iterator1>& x,
const reverse_iterator<Iterator2>& y);
Returns: x.current <= y.current.
template <class Iterator1, class Iterator2>
bool operator<=(
const reverse_iterator<Iterator1>& x,
const reverse_iterator<Iterator2>& y);
Returns: x.current >= y.current.
template <class Iterator1, class Iterator2>
auto operator-(
const reverse_iterator<Iterator1>& x,
const reverse_iterator<Iterator2>& y) -> decltype(y.current - x.current);
Returns: y.current - x.current.
template <class Iterator>
reverse_iterator<Iterator> operator+(
typename reverse_iterator<Iterator>::difference_type n,
const reverse_iterator<Iterator>& x);
Returns: reverse_iterator<Iterator> (x.current - n).