Namespaces
Variants
Views
Actions

std::reverse_iterator<Iter>::operator++,+,+=,--,-,-=

From cppreference.com
 
 
Iterator library
Iterator concepts
Iterator primitives
Iterator adaptors
Stream iterators
Iterator customization points
Iterator operations
(C++11)
(C++11)
Range access
(C++11)(C++14)
(C++11)(C++14)
(C++17)(C++20)
(C++14)(C++14)
(C++14)(C++14)
(C++17)
(C++17)
 
std::reverse_iterator
Member functions
reverse_iterator::operator++reverse_iterator::operator+reverse_iterator::operator+=reverse_iterator::operator--reverse_iterator::operator-reverse_iterator::operator-=
Non-member functions
(C++20)
(C++20)
 
(1)
reverse_iterator& operator++();
(until C++17)
constexpr reverse_iterator& operator++();
(since C++17)
(2)
reverse_iterator& operator--();
(until C++17)
constexpr reverse_iterator& operator--();
(since C++17)
(3)
reverse_iterator operator++( int );
(until C++17)
constexpr reverse_iterator operator++( int );
(since C++17)
(4)
reverse_iterator operator--( int );
(until C++17)
constexpr reverse_iterator operator--( int );
(since C++17)
(5)
reverse_iterator operator+( difference_type n ) const;
(until C++17)
constexpr reverse_iterator operator+( difference_type n ) const;
(since C++17)
(6)
reverse_iterator operator-( difference_type n ) const;
(until C++17)
constexpr reverse_iterator operator-( difference_type n ) const;
(since C++17)
(7)
reverse_iterator& operator+=( difference_type n );
(until C++17)
constexpr reverse_iterator& operator+=( difference_type n );
(since C++17)
(8)
reverse_iterator& operator-=( difference_type n );
(until C++17)
constexpr reverse_iterator& operator-=( difference_type n );
(since C++17)

Increments or decrements the iterator. Inverse operations are applied to the underlying operator because of the reverse order.

1-2) Pre-increments or pre-decrements by one respectively.
3-4) Post-increments or post-decrements by one respectively.
5-6) Returns an iterator which is advanced by n or -n positions respectively.
7-8) Advances the iterator by n or -n positions respectively.

[edit] Return value

1-2) *this
3-4) a copy of *this that was made before the change
5-6) reverse_iterator(base()-n) or reverse_iterator(base()+n) respectively.
7-8) *this

[edit] Example

[edit] See also

advances the iterator
(function template) [edit]