std::experi...ranges::prev(3)

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

🌸 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.

  1. Equivalent to --i; return i;. simple, iconic.
  2. Equivalent to ranges::advance(i, -n); return i;.
  3. 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