A RetroSearch Logo

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

Search Query:

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

public member function

<iterator>

std::move_iterator::operator-- (1)
move_iterator& operator--();
(2)
move_iterator  operator--(int);

Decrease iterator position

Decreases the iterator by one position.

Internally, the pre-decrement version (1) simply reflects the operation into its base iterator .

The post-decrement version (2) is implemented with a behavior equivalent to:


1
2
3
4
5
move_iterator operator--(int) {
  move_iterator temp = *this;
  --(*this);
  return temp;
}

Note that this function requires the base iterator to be at least a bidirectional iterator.

Parameters none (the second version overloads the post-decrement operator).

Return value The pre-decrement version (1) returns *this.
The post-decrement version (2) returns the value *this had before the call.

Data races Modifies the object.
The iterator returned can be used to access or modify pointed elements.

Exception safety Provides the same level of guarantee as decreasing (and copying, for (2)) the base iterator.

See also
move_iterator::operator++
Increment 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