std::ranges...brange::size(3)

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

okay bestie, welcome to the C++ Standard Libary manual πŸ’– we’re looking at the page whose header label is std::ranges...brange::size(3), and the actual name is std::ranges::subrange::size. yes, the header is a little squished β€” we move.

🌸 NAME 🌸

std::ranges::subrange::size β€” std::ranges::subrange::size

✨ Synopsis ✨

          constexpr /* see below */ size() const             (since C++20)
              requires (K == ranges::subrange_kind::sized);

Obtains the number of elements in the subrange. 🫢

The return type is the corresponding unsigned version of std::iter_difference_t<I>.

πŸŽ€ Parameters πŸŽ€

(none) β€” literally no parameters, she’s low-maintenance πŸ’…

πŸ¦‹ Return value πŸ¦‹

s_ - i_ explicitly converted to the return type, where i_ and s_ are the stored iterator and sentinel respectively, if the size is not stored.

Otherwise, the stored size.

🌈 Notes 🌈

The size is stored into a subrange if and only if K == ranges::subrange_kind::sized but std::sized_sentinel_for<S, I> is not satisfied.

πŸ“ Example πŸ“

This section is incomplete Reason: no example

πŸ”₯ See also πŸ”₯

  • empty β€” checks whether the subrange is empty; (C++20), and it’s a public member function.
  • size β€” the bare size line from the See also block (that’s literally all the original gives it).
  • ssize β€” returns the size of a container or array; (C++17), (C++20), and it’s a function template.
  • ranges::size β€” returns an integer equal to the size of a range; (C++20), and it’s a customization point object.

🏷️ Category 🏷️

  • Todo no example

k bye bestie πŸ’– source: http://cppreference.com Β· version/date: 2024.06.10 Β· footer page label: std::ranges...brange::size(3) ✨

πŸ“¦ where this page comes from