std::move_i...+,+=,--,-,-=(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

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 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)

πŸ“Œ 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