std::experi...nges::Range(3)

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

πŸ’– 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) and ranges::end(t) are amortized constant time and non-modifying.
  • If ranges::iterator_t<T> satisfies ForwardIterator, 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