std::experi...nges::Range(3)
π NAME π
Okay bestie, this std::experi...nges::Range(3) page is from the C++ Standard Libary manual, and the name is literally std::experimental::ranges::Range - std::experimental::ranges::Range π«Ά. Thatβs the whole NAME situation. Iconic, honestly.
β¨ Synopsis β¨
Defined in header <experimental/ranges/range>.
template< class T >
concept bool Range =
requires(T&& t) {
ranges::begin(t); /* not necessarily equality-preserving (see
(ranges TS)
below) */
ranges::end(t);
};
So Range is a concept bool with template< class T >, and the vibe check is that requires(T&& t) block: ranges::begin(t) and ranges::end(t) have to be there, periodt π
. The comment on ranges::begin(t) says itβs not necessarily equality-preserving (see below) β and yes, the (ranges TS) bit belongs to that note, so donβt lose it π.
Now the real tea: given an lvalue t of type std::remove_reference_t<T>, Range<T> is satisfied only if these hold:
[ranges::begin(t), ranges::end(t))denotes a range; and- both
ranges::begin(t)andranges::end(t)are amortized constant time and non-modifying. - If
ranges::iterator_t<T>satisfiesForwardIterator,ranges::begin(t)is equality preserving.
No cap, those bullets are the whole requirements set on this page β keep every single one πΈ.
Okay thatβs the page π
source is http://cppreference.com, version/date is 2024.06.10, and the page is std::experi...nges::Range(3). byeee bestie π«Άπ
π¦ 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