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

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

πŸ¦‹ NAME πŸ¦‹

okay so bestie, welcome to the manual page for std::ranges...++,--,+=,-=(3) from the C++ Standard Libary manual πŸ’…βœ¨ and the NAME is literally std::ranges::zip_view::iterator::operator++,--,+=,-= β€” yes, and then it says std::ranges::zip_view::iterator::operator++,--,+=,-= again, because one extremely long name clearly wasn’t enough πŸ’€.


✨ Synopsis ✨

here’s the whole synopsis, no cap β€” every single one of these is constexpr and every single one is (since C++23) πŸŽ€:

constexpr /*iterator*/& operator++();                   (1) (since C++23)
constexpr void operator++( int );                       (2) (since C++23)
constexpr /*iterator*/ operator++( int )                (3) (since C++23)
  requires /*all-forward*/<Const, Views...>;
constexpr /*iterator*/& operator--()                    (4) (since C++23)
  requires /*all-bidirectional*/<Const, Views...>;
constexpr /*iterator*/ operator--( int )                (5) (since C++23)
  requires /*all-bidirectional*/<Const, Views...>;
constexpr /*iterator*/& operator+=( difference_type n ) (6) (since C++23)
  requires /*all-random-access*/<Const, Views...>;
constexpr /*iterator*/& operator-=( difference_type n ) (7) (since C++23)
  requires /*all-random-access*/<Const, Views...>;

The vibe check: it increments or decrements each of the underlying is_... iterators in the underlying tuple-like object current_ πŸŒ€.

  • (1) β€” equivalent to /*tuple-for-each*/([](auto& i) { ++i; }, current_); return *this;
  • (2) β€” equivalent to ++*this;
  • (3) β€” equivalent to auto tmp = *this; ++*this; return tmp;
  • (4) β€” equivalent to /*tuple-for-each*/([](auto& i) { --i; }, current_); return *this;
  • (5) β€” equivalent to auto tmp = *this; --*this; return tmp;
  • (6) β€” equivalent to /*tuple-for-each*/([&]<class I>(I& i) { i += iter_difference_t<I>(x); }, current_); return *this;
  • (7) β€” equivalent to /*tuple-for-each*/([&]<class I>(I& i) { i -= iter_difference_t<I>(x); }, current_); return *this;

πŸ’– Parameters πŸ’–

  • n β€” position relative to current location ✨

πŸŽ€ Return value πŸŽ€

  • (1), (4), (6), (7) β€” *this
  • (2) β€” (none)
  • (3), (5) β€” a copy of *this that was made before the change 🫢

🌸 Example 🌸

This section is incomplete 🫠

Reason: no example


πŸ’… Category πŸ’…

  • Todo no example

byeee bestie πŸ’– this page is from http://cppreference.com, version/date 2024.06.10, and the footer tag is std::ranges...++,--,+=,-=(3) πŸ¦‹βœ¨

πŸ“¦ where this page comes from