std::move_i...+,+=,--,-,-=(3)
Hey bestie π welcome to the (3) manual page for std::move_i...+,+=,--,-,-=, straight outta the C++ Standard Libary (yes, that's the spelling in the header β we keep it iconic). This is the whole operator squad for std::move_iterator: operator++, +, +=, --, -, -=. Periodt.
π NAME π
std::move_iterator::operator++, +, +=, --, -, -= β and the page name says it again: std::move_iterator::operator++,+,+=,--,-,-=. It's giving operator family reunion and honestly? Obsessed. π«Ά
π Synopsis π
Here's the synopsis, copied exactly β the column layout is doing its own little chaos dance, iykyk:
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 );
So what does it all mean? Increments or decrements the iterator. That's the whole vibe check.
- 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
nor-npositions respectively. - 7,8) Advances the iterator by
nor-npositions respectively.
π Parameters π
nβ position relative to current location
π Return value π
- 1,2)
*this - 3,4) A copy of
*thisthat was made before the change; however, ifIterdoes not modelforward_iterator, the post-increment operator does not return such copy and the return type isvoid(since C++20). - 5,6)
move_iterator(base()+n)ormove_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)
π Category π
- Todo no example
That's the tea π΅ β source/version http://cppreference.com, date 2024.06.10, page std::move_i...+,+=,--,-,-=(3). Bye bestie, go increment something cute πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms