std::ranges...brange::size(3)
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 baresizeline 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
- 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