std::ranges...erface::cend(3)

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

πŸ’– NAME πŸ’–

std::ranges::view_interface::cend β€” std::ranges::view_interface::cend. Okay bestie, this is page std::ranges...erface::cend(3) from the C++ Standard Libary manual, and the name is literally doing the self-titled album thing πŸ’Ώβœ¨.

✨ Synopsis ✨

          constexpr auto cend();                                       (1)
       (since C++23)
          constexpr auto cend() const requires ranges::range<const D>; (2)
       (since C++23)

The default implementation of the cend() member function returns the sentinel for the constant iterator of the range. That’s the assignment, no cap 🫢.

There’s also a diagram ref in the original: range-begin-end.svg β€” visual aid, iconic behavior 🌈.

  1. Let derived be a reference bound to static_cast<D&>(*this). Equivalent to return ranges::cend(derived);.
  2. Same as (1), except that derived is static_cast<const D&>(*this).

🌸 Parameters 🌸

(none) β€” literally none, not even one, we love a low-maintenance icon πŸ’….

πŸ¦‹ Return value πŸ¦‹

The sentinel for the constant iterator of the range. Periodt ✨.

πŸŽ€ Notes πŸŽ€

All range adaptors and range factories in the standard library and std::ranges::subrange use the default implementation of cend. That’s the tea β˜•πŸ‘‘.

πŸ’€ Example πŸ’€

This section is incomplete β€” Reason: no example 😭

It’s giving placeholder era, but we respect the honesty.

🌈 See also 🌈

  • end β€” returns an iterator to the end of a container or array (C++11) (function template)
  • cend β€” returns an iterator to the end of a container or array (C++14) (function template)
  • ranges::cend β€” returns a sentinel indicating the end of a read-only range (C++20) (customization point object)

πŸ—‚οΈ Category πŸ—‚οΈ

Category: * Todo no example


mwah πŸ’‹ β€” source/version/date: http://cppreference.com β€’ 2024.06.10 β€’ page std::ranges...erface::cend(3). Bye bestie, go slay your ranges πŸ§šπŸ’œ

πŸ“¦ where this page comes from