Scroll to navigation

std::move_iterator::operator++,+,+=,--,-,-=(3) C++ Standard Libary std::move_iterator::operator++,+,+=,--,-,-=(3)

NAME

std::move_iterator::operator++,+,+=,--,-,-= - std::move_iterator::operator++,+,+=,--,-,-=

Synopsis


move_iterator& (until
operator++(); C++17)
constexpr (since
move_iterator& C++17)
operator++();
move_iterator& (until
operator--(); C++17)
constexpr (since
move_iterator& C++17)
operator--();
move_iterator (until
operator++( int C++17)
);
constexpr (since
move_iterator C++17)
operator++( int (until
); C++20)
constexpr auto (since
operator++( int C++20)
);
move_iterator (until
operator--( int C++17)
);
constexpr
move_iterator (since
operator--( int C++17)
);
move_iterator
operator+( (until
difference_type C++17)
n ) const;
constexpr (1)
move_iterator (since
operator+( (2) C++17)
difference_type
n ) const;
move_iterator (3)
operator-( (until
difference_type C++17)
n ) const;
constexpr
move_iterator (4) (since
operator-( C++17)
difference_type
n ) const; (5)
move_iterator&
operator+=( (until
difference_type C++17)
n );
constexpr (6)
move_iterator& (since
operator+=( C++17)
difference_type
n ); (7)
move_iterator&
operator-=( (until
difference_type C++17)
n );
constexpr (8)
move_iterator& (since
operator-=( C++17)
difference_type
n );


Increments or decrements the iterator.


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.

Parameters


n - position relative to current location.

Return value


1-2) *this.
3-4) a copy of *this that was made before the change
, however, if Iter does not model forward_iterator, the post-increment operator does
not return such copy and the return type is void
(since C++20).
5-6) move_iterator(base()+n) or move_iterator(base()-n) respectively.
7-8) *this.

Example


This section is incomplete
Reason: no example

See also


operator+ advances the iterator
(C++11) (function template)
operator- computes the distance between two iterator adaptors
(C++11) (function template)

2022.07.31 http://cppreference.com