Ranges library (C++20)
From cppreference.com
< cpp
The ranges library provides components for dealing with ranges of elements, including a variety of view adapters.
| Defined in header <ranges>
|
||
| namespace std { namespace view = ranges::view; |
||
The namespace alias std::view is provided as a shorthand for std::ranges::view.
| Defined in header
<ranges> | |
| Defined in namespace
std::ranges | |
Range access | |
| returns an iterator to the beginning of a range (customization point object) | |
| returns an iterator to the end of a range (customization point object) | |
| returns a reverse iterator to a range (customization point object) | |
| returns a reverse end iterator to a range (customization point object) | |
Range primitives | |
| obtains the size of a range whose size can be calculated in constant time (customization point object) | |
| checks whether a range is empty (customization point object) | |
| obtains a pointer to the beginning of a contiguous range (customization point object) | |
| obtains the iterator and sentinel types of a range (alias template) | |
Range concepts | |
specifies that a type is a range, that is, it provides a begin iterator and an end sentinel (concept) | |
| specifies that a range knows its size in constant time (concept) | |
| specifies that a range is a view, that is, it has constant time copy/move/assignment (concept) | |
specifies a range whose iterator type satisfies InputIterator (concept) | |
specifies a range whose iterator type satisfies OutputIterator (concept) | |
specifies a range whose iterator type satisfies ForwardIterator (concept) | |
specifies a range whose iterator type satisfies BidirectionalIterator (concept) | |
specifies a range whose iterator type satisfies RandomAccessIterator (concept) | |
specifies a range whose iterator type satisfies ContiguousIterator (concept) | |
| specifies that a range has identical iterator and sentinel types (concept) | |
specifies the requirements for a Range to be safely convertible to a View (concept) | |
Views | |
helper class template for defining Views, using the curiously recurring template pattern (class template) | |
combines an iterator-sentinel pair into a View (class template) | |
Adaptors | |
a View that includes all elements of a Range (alias template) (range adaptor object) | |
a View that consists of the elements of a Range that satisfies a predicate (class template) (range adaptor object) | |
a View of a sequence that applies a transformation function to each element (class template) (range adaptor object) | |
a View consisting of a sequence generated by repeatedly incrementing an initial value (class template) (range adaptor object) | |
a View consisting of the first N elements of another View (class template) (range adaptor object) | |
a View consisting of the sequence obtained from flattening a View of Ranges (class template) (range adaptor object) | |
an empty View with no elements (class template) (range adaptor object) | |
a View that contains a single element of a specified value (class template) (range adaptor object) | |
a View over the subranges obtained from splitting another View using a delimiter (class template) (range adaptor object) | |
| creates a subrange from an iterator and a count (customization point object) | |
converts a View into a CommonRange (class template) (range adaptor object) | |
a View that iterates over the elements of another bidirectional view in reverse order (class template) (range adaptor object) | |