std::ranges...++,--,+=,-=(3)
π std::ranges::transform_view::iterator::operator++,--,+=,-= π
okay so bestie, this is from the C++ Standard Libary, man page (3), and it's literally the transform_view iterator's whole ++, --, +=, -= era. The NAME is a mouthful and the original hits you with it twice β dash in the middle and everything. No cap, it's giving iterator arithmetic main character energy π
.
β¨ NAME β¨
std::ranges::transform_view::iterator::operator++,--,+=,-=β that's the name, exactly. The original NAME line repeats it twice with a dash between:std::ranges::transform_view::iterator::operator++,--,+=,-= - std::ranges::transform_view::iterator::operator++,--,+=,-=.
π Synopsis π
here's the overload lineup, and every single one is since C++20, bestie:
constexpr /*iterator*/& operator++(); (1) (since
C++20)
constexpr void operator++( int ); (2) (since
C++20)
constexpr /*iterator*/ operator++( int ) (3) (since
C++20)
requires ranges::forward_range<Base>;
constexpr /*iterator*/& operator--() (4) (since
C++20)
requires ranges::bidirectional_range<Base>;
constexpr /*iterator*/ operator--( int ) (5) (since
C++20)
requires ranges::bidirectional_range<Base>;
constexpr /*iterator*/& operator+=( difference_type n ) (6) (since
C++20)
requires ranges::random_access_range<Base>;
constexpr /*iterator*/& operator-=( difference_type n ) (7) (since
C++20)
requires ranges::random_access_range<Base>;
Increments or decrements the iterator. Let current_ be the underlying iterator. Here's the exact equivalences, no additions from me:
- 1) Equivalent to
++current_; return *this; - 2) Equivalent to
++current_; - 3) Equivalent to
auto tmp = *this; ++*this; return tmp; - 4) Equivalent to
--current_; return *this; - 5) Equivalent to
auto tmp = *this; --*this; return tmp; - 6) Equivalent to
current_ += n; return *this; - 7) Equivalent to
current_ -= n; return *this;
π Parameters π
nβ position relative to current location.
π Return value π
1,4,6,7)β*this3,5)β a copy of*thisthat was made before the change
bestie note: that Return value list is exactly what the page says β 2 is not listed there, so I'm not inventing anything. periodt π«Ά
okay bestie, that's the whole (3) page π source: http://cppreference.com, version/date: 2024.06.10, and the footer title is literally std::ranges...++,--,+=,-=(3). slay β¨
π¦ 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