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

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

πŸ’– NAME πŸ’–

okay so bestie, we're on the std::ranges::chunk_by_view::iterator::operator++,-- page from the C++ Standard Libary ✨ and the name situation is literally:

  • std::ranges::chunk_by_view::iterator::operator++,-- β€” std::ranges::chunk_by_view::iterator::operator++,--

no cap, that's the whole name vibe πŸ’…


✨ Synopsis ✨

here's the icon lineup, all since C++23 πŸŽ€

  • constexpr /*iterator*/& operator++(); β€” (1) (since C++23)
  • constexpr /*iterator*/ operator++(int); β€” (2) (since C++23)
  • constexpr /*iterator*/& operator--() requires ranges::bidirectional_range<V>; β€” (3) (since C++23)
  • constexpr /*iterator*/ operator--(int) requires ranges::bidirectional_range<V>; β€” (4) (since C++23)

on the page it's laid out like this, lowkey:

constexpr /*iterator*/& operator++();

(1) (since C++23)

constexpr /*iterator*/ operator++(int);

(2) (since C++23)

constexpr /*iterator*/& operator--() requires
  ranges::bidirectional_range<V>;

(3) (since C++23)

constexpr /*iterator*/ operator--(int) requires
  ranges::bidirectional_range<V>;

(4) (since C++23)

Increments or decrements the iterator. periodt πŸ’«

Let parent_, current_, and next_ be the appropriate underlying (exposition-only) data-members of iterator.

Let find-next and find-prev be appropriate (exposition-only) member functions of ranges::chunk_by_view.


  1. operator++() (1) β€” Equivalent to:
current_ = next_;
next_ = parent_->/*find-next*/(current_);
return *this;

🚨 The behavior is undefined if before the call to this operator current_ is equal to next_. like bestie, that's the danger zone, do not go there πŸ’€

  1. operator++(int) (2) β€” Equivalent to: auto tmp = *this; ++*this; return tmp;
  2. operator--() (3) β€” Equivalent to:
next_ = current_;
current_ = parent_->/*find-prev*/(next_);
return *this;
  1. operator--(int) (4) β€” Equivalent to: auto tmp = *this; --*this; return tmp;

🫢 Parameters 🫢

  • (none) πŸ¦‹

πŸŽ€ Return value πŸŽ€

  • 1,3) *this
  • 2,4) a copy of *this that was made before the change.

and that's the whole page, bestie πŸ’– lil sign-off kiss: source/version is http://cppreference.com, date is 2024.06.10, and the page tag is std::ranges...perator++,--(3) 🌸 mwah 🫢

πŸ“¦ where this page comes from