Namespaces
Variants
Views
Actions

Ranges library (C++20)

From cppreference.com
< cpp
 
 
Ranges library
Range access
Range primitives
Range concepts
Views
                              
                              
Adaptors
                              
                              
                              
                              
                              
 

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

Contents

Range access
returns an iterator to the beginning of a range
(customization point object) [edit]
returns an iterator to the end of a range
(customization point object) [edit]
returns a reverse iterator to a range
(customization point object) [edit]
returns a reverse end iterator to a range
(customization point object) [edit]
Range primitives
obtains the size of a range whose size can be calculated in constant time
(customization point object) [edit]
checks whether a range is empty
(customization point object) [edit]
obtains a pointer to the beginning of a contiguous range
(customization point object) [edit]
obtains the iterator and sentinel types of a range
(alias template) [edit]
Range concepts
specifies that a type is a range, that is, it provides a begin iterator and an end sentinel
(concept) [edit]
specifies that a range knows its size in constant time
(concept) [edit]
specifies that a range is a view, that is, it has constant time copy/move/assignment
(concept) [edit]
specifies a range whose iterator type satisfies InputIterator
(concept) [edit]
specifies a range whose iterator type satisfies OutputIterator
(concept) [edit]
specifies a range whose iterator type satisfies ForwardIterator
(concept) [edit]
specifies a range whose iterator type satisfies BidirectionalIterator
(concept) [edit]
specifies a range whose iterator type satisfies RandomAccessIterator
(concept) [edit]
specifies a range whose iterator type satisfies ContiguousIterator
(concept) [edit]
specifies that a range has identical iterator and sentinel types
(concept) [edit]
specifies the requirements for a Range to be safely convertible to a View
(concept) [edit]
Views
helper class template for defining Views, using the curiously recurring template pattern
(class template) [edit]
combines an iterator-sentinel pair into a View
(class template) [edit]
Adaptors
a View that includes all elements of a Range
(alias template) (range adaptor object) [edit]
a View that consists of the elements of a Range that satisfies a predicate
(class template) (range adaptor object) [edit]
a View of a sequence that applies a transformation function to each element
(class template) (range adaptor object) [edit]
a View consisting of a sequence generated by repeatedly incrementing an initial value
(class template) (range adaptor object) [edit]
a View consisting of the first N elements of another View
(class template) (range adaptor object) [edit]
a View consisting of the sequence obtained from flattening a View of Ranges
(class template) (range adaptor object) [edit]
an empty View with no elements
(class template) (range adaptor object) [edit]
a View that contains a single element of a specified value
(class template) (range adaptor object) [edit]
a View over the subranges obtained from splitting another View using a delimiter
(class template) (range adaptor object) [edit]
creates a subrange from an iterator and a count
(customization point object) [edit]
converts a View into a CommonRange
(class template) (range adaptor object) [edit]
a View that iterates over the elements of another bidirectional view in reverse order
(class template) (range adaptor object) [edit]