std::ranges...++,--,+=,-=(3)
π std::ranges...++,--,+=,-=(3) π
Okay bestie, welcome to the C++ Standard Libary manual π. This page is literally std::ranges...++,--,+=,-=(3), and it's all about the std::ranges::cartesian_product_view::iterator operators ++, --, +=, and -=. The way that's a whole mouthful β slay, but also hydrate. π«Ά
π NAME π
std::ranges::cartesian_product_view::iterator::operator++,--,+=,-= β yes, that's the name, and the page says it again: std::ranges::cartesian_product_view::iterator::operator++,--,+=,-=. Repetition is the main character energy here. π
β¨ Synopsis β¨
constexpr /*iterator*/& operator++();
(1) (since C++23)
constexpr void operator++( int );
(2) (since C++23)
constexpr /*iterator*/ operator++( int )
(3) (since C++23)
requires ranges::forward_range</*maybe-const*/<Const, First>>;
constexpr /*iterator*/& operator--()
requires /*cartesian-product-is-bidirectional*/<Const, First,
(4) (since C++23)
Vs...>;
constexpr /*iterator*/ operator--( int )
requires /*cartesian-product-is-bidirectional*/<Const, First,
(5) (since C++23)
Vs...>;
constexpr /*iterator*/& operator+=( difference_type n )
requires /*cartesian-product-is-random-access*/<Const, First,
(6) (since C++23)
Vs...>;
constexpr /*iterator*/& operator-=( difference_type n )
requires /*cartesian-product-is-random-access*/<Const, First,
(7) (since C++23)
Vs...>;
Increments or decrements the iterator. Let current_ denote the underlying tuple of iterators and parent_ denote the underlying pointer to cartesian_product_view. No cap. πΈ
- (1) Equivalent to
next(); return *this; - (2) Equivalent to
++*this; - (3) Equivalent to
auto tmp = *this; ++*this; return tmp; - (4) Equivalent to
prev(); return *this; - (5) Equivalent to
auto tmp = *this; --*this; return tmp; - (6) Sets the value of
*thistoret, whereretis:- if
n > 0, the value of*thisprovided thatnextbeen calledntimes. Otherwise, - if
n < 0, the value of*thisprovided thatprevbeen called-ntimes. Otherwise, - the value of
*thisbefore the call.
- if
β οΈ Undefined behavior for (6): the behavior is undefined ifnis not in the range[ranges::distance(*this, ranges::begin(*parent_)), ranges::distance(*this, ranges::end(*parent_))). Like, do not play with that, bestie. π
- (7) Equivalent to
*this += -n; return *this;.
π Parameters π
nβ position relative to current location.
π Return value π
- 1,4,6,7) β
*this - 2) β (none)
- 3,5) β a copy of
*thisthat was made before the change.
π₯ Complexity π₯
- 6) β
Constant.Short and sweet, periodt.
πΈ Example πΈ
This section is incomplete.
Reason: no example.
π¦ See also π¦
operator+performs iterator arithmeticoperator-(function)(C++23)
π·οΈ Category:
- Todo no example
π Source/version check: http://cppreference.com, dated 2024.06.10. Byeee, go slay those iterators π«Άβ¨
π¦ 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