A global overload for operator+ with the same behavior also exists for the case where the reverse_iterator is the right-hand side element of the sum:
| 1 2 3 4 |
|
Parameters
- n
- Number of elements to offset.
difference_type is a member type defined as an alias of the base iterator's own difference type (generally, a integral type).
Return value
The reverse iterator itself (*this).Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Output:
The fourth element from the end is : 6 |
See also
| reverse_iterator::operator- | Subtraction operator (public member function) |
| reverse_iterator::operator++ | Increment iterator position (public member function) |
| reverse_iterator::operator+= | Advance iterator (public member function) |
