A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/move_iterator::operator- below:

public member function

<iterator>

std::move_iterator::operator-
move_iterator operator- (difference_type n) const;

Subtraction operator

Returns a move iterator pointing to the element located n positions before the element the iterator currently points to.

Internally, the function reflects the operation onto the base iterator and returns a move iterator constructed with the resulting value.

Note that this function requires the base iterator to be a random-access iterator.

This operator is also overloaded as a non-member function to return the difference of subtracting iterators: see operator-).


Parameters
n
Number of elements to offset backwards.
Member type difference_type is an alias of the base iterator's own difference type.

Return value A move iterator pointing to the element n positions before the currently pointed one.

Data races The object is accessed.
The iterator returned can be used to access or modify elements.

Exception safety Provides the same level of guarantee as the operations internally applied to the base iterator.

See also
move_iterator::operator+
Addition operator (public member function)
move_iterator::operator--
Decrease iterator position (public member function)
move_iterator::operator-=
Decrease iterator (public member function)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4