std::experi...ranges::prev(3)
πΈ std::experi...ranges::prev(3) πΈ
okay so welcome to the std::experi...ranges::prev(3) page, bestie, from the C++ Standard Libary β yes that's the manual name folded in right here, cute and cozy β¨. ngl this page is short but it's giving niche iterator customization point energy, and we're gonna read every crumb together π
.
π NAME π
std::experimental::ranges::prev - std::experimental::ranges::prev, literally the same name twice and honestly iconic.
β¨ Synopsis β¨
Defined in header <experimental/ranges/iterator> π
namespace {
constexpr /* unspecified */ prev = /* unspecified */;
}
- it's marked
(ranges TS), iykyk. - it's a
(customization point object), which is the whole vibe fr fr.
π Call signature π
template< Iterator I > (1)
constexpr I prev( I i );
template< Iterator I > (2)
constexpr I prev( I i, ranges::difference_type_t<I> n );
template< Iterator I >
constexpr I prev( I i, ranges::difference_type_t<I> n, I (3)
bound );
so what does it actually do? it decrements the iterator i n times, or until bound is reached, whichever comes first, and returns the decremented iterator. periodt.
- Equivalent to
--i; return i;. simple, iconic. - Equivalent to
ranges::advance(i, -n); return i;. - Equivalent to
ranges::advance(i, -n, bound); return i;.
π Return value π
The decremented iterator. that's it, that's the tea π.
π¦ Example π¦
This section is incomplete β Reason: no example π. not me showing up to the group chat with no example, embarrassing.
π₯ See also π₯
prev(C++11)β decrement an iterator (function template)advanceβ advances an iterator by given distance (function template)nextβ increment an iterator (function template)distanceβ returns the distance between an iterator and a sentinel, or between the beginning and the end of a range (function template)
π Category π
* Todo no exampleβ yeah bestie, that's the todo tag, fr fr.
mwah π source/version check: this page is from http://cppreference.com, dated 2024.06.10, and it's the std::experi...ranges::prev(3) page. bye bestie, go decrement something cute π«Άβ¨
π¦ 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