| ||||||||||||||||||||||
| Range primitives | |||||||
| |||||||
| Range concepts | ||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||
| Range factories | |||||||||
| |||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helper items | |||||||||||||||||
| |||||||||||||||||
Defined in header <ranges> | ||
template<class T> concept common_range= | (since C++20) | |
Thecommon_range concept is a refinement ofrange for whichstd::ranges::begin() andstd::ranges::end() return the same type (e.g. all standard library containers).
#include <ranges> struct A{char* begin();char* end();};static_assert( std::ranges::common_range<A>); struct B{char* begin();bool end();};// not a common_range: begin/end have different typesstatic_assert( not std::ranges::common_range<B>); struct C{char* begin();};// not a common_range, not even a range: has no end()static_assert( not std::ranges::common_range<C>); int main(){}
converts aview into acommon_range(class template)(range adaptor object)[edit] |