std::ranges::range(3cxx)

πŸ“¦
version 16-20260322 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– std::ranges::range πŸ’–

okay bestie, welcome to the std::ranges::range page, straight out of the 3cxx manual (that's the C++ manpage section, iykyk) ✨


🌸 NAME 🌸

std::ranges::range β€” [range.range] the range concept. that's it, that's the whole vibe. she's a concept, not a class, and she's iconic for it πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

first things first, you gotta bring her in:

#include <ranges>

πŸŽ€ Concept definition πŸŽ€

here's the whole girl, verbatim, no notes:

template<typename _Tp>
concept std::ranges::range =  requires(_Tp& __t)
      {
        ranges::begin(__t);
        ranges::end(__t);
      }

so like. a type _Tp is a range if β€” given an lvalue ref __t to it β€” ranges::begin(__t) and ranges::end(__t) both work. that's the vibe check. if you can begin it and you can end it, congrats, you're a range 🫢✨


πŸ’œ Detailed Description πŸ’œ

[range.range] The range concept. periodt. no cap, that's genuinely the description β€” she's a concept, she doesn't need a whole essay, she lets the requires-clause do the talking πŸ˜­πŸ‘‘

fr fr: this is a concept, so you can't instantiate it, you can only ask "is this a range?" and get a yes or a no. no runtime, all compile time, main character energy only.

🌈 Author 🌈

Generated automatically by Doxygen for libstdc++ from the source code. so like, not a human, not a bestie, just doxygen doing doxygen things πŸ™ˆπŸ’€ (we still appreciate her though)


🌟 SEE ALSO 🌟

nope, nothing here bestie β€” no cross-refs on this one. it's giving minimal. it's giving "I am the reference" πŸ’…


and that's the whole page, you ate that πŸ“

this lil masterpiece comes to you from libstdc++, living in the std::ranges::range(3cxx) section of your friendly neighbourhood manpages. go read some ranges, ily, bye πŸ’–πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from