std::experimental::ranges::View
From cppreference.com
< cpp | experimental | ranges
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Experimental
Filesystem library (filesystem TS)
Library fundamentals (library fundamentals TS)
Library fundamentals 2 (library fundamentals TS v2)
Library fundamentals 3 (library fundamentals TS v3)
Extensions for parallelism (parallelism TS)
Extensions for parallelism 2 (parallelism TS v2)
Extensions for concurrency (concurrency TS)
Extensions for concurrency 2 (concurrency TS v2)
Concepts (concepts TS)
Ranges (ranges TS)
Reflection (reflection TS)
Mathematical special functions (special functions TR)
Ranges library
Range concepts
Range access
Range primitives
Defined in header
<experimental/ranges/range>
template< class T >
concept bool View = Range<T> && Semiregular<T> && /* view-predicate<T> */;
(ranges TS)
concept bool View = Range<T> && Semiregular<T> && /* view-predicate<T> */;
template< class T >
struct enable_view {};
(ranges TS)
struct enable_view {};
struct view_base {};
(ranges TS)
The concept View<T>
specifies the semiregular range T
has constant-time copy, move, and assignment operations.
The /* view-predicate<T> */ portion of the concept is determined as follows:
- if the qualified-id ranges::enable_view <T>::type is valid and denotes a type, ranges::enable_view <T>::type::value;
- otherwise, if std::is_base_of_v <ranges::view_base, T> is true, true;
- otherwise, if
T
is a specialization of std::initializer_list , std::set , std::multiset , std::unordered_set , or std::unordered_multiset , false; - otherwise, if both
T
andconst T
satisfyRange
and ranges::reference_t <ranges::iterator_t <T>> is not the same type as ranges::reference_t<ranges::iterator_t <const T>>, false; - otherwise, true.