Extensions for ranges
From cppreference.com
< cpp | experimental
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)
The C++ Extensions for Ranges, ISO/IEC TS 21425:2017, specifies one modification to the core language and defines new components for the C++ standard library listed on this page.
The Ranges TS is based on the C++14 standard as modified by the Concepts TS.
Merged into ISO C++ The functionality described on this page was merged into the mainline ISO C++ standard as of 10/2018; see the ranges library, the constrained algorithms library, and the core concepts library (since C++20)
Contents
[edit] Core language changes
The Ranges TS modifies the specification of the range-based for loop to permit differently typed begin and end iterators. This change permits the use of sentinels and is also present in C++17.
[edit] Concepts
Core language concepts
Defined in header
<experimental/ranges/concepts> Defined in namespace
std::experimental::ranges
specifies that a type can be swapped or that two types can be swapped with each other
(concept) [edit]
(concept) [edit]
Comparison concepts
Defined in header
<experimental/ranges/concepts> Defined in namespace
std::experimental::ranges Object concepts
Defined in header
<experimental/ranges/concepts> Defined in namespace
std::experimental::ranges
specifies that a variable of the type can be constructed from or bound to a set of argument types
(concept) [edit]
(concept) [edit]
specifies that an object of a type can be copied, moved, swapped, and default constructed
(concept) [edit]
(concept) [edit]
specifies that a type is regular, that is, it is both
(concept) [edit]
Semiregular and EqualityComparable (concept) [edit]
Callable concepts
Defined in header
<experimental/ranges/concepts> Defined in namespace
std::experimental::ranges Random number generator concept
Defined in header
<experimental/ranges/random> Defined in namespace
std::experimental::ranges [edit] General utilities
Utility components
Defined in header
<experimental/ranges/utility> Defined in namespace
std::experimental::ranges Function objects
Defined in header
<experimental/ranges/functional> Defined in namespace
std::experimental::ranges Metaprogramming and type traits
Defined in header
<experimental/ranges/type_traits> Defined in namespace
std::experimental::ranges
checks if objects of a type can be swapped with objects of same or different type
(class template) [edit]
(class template) [edit]
Tagged pairs and tuples
Defined in header
<experimental/ranges/utility> Defined in namespace
std::experimental::ranges Defined in header
<experimental/ranges/tuple> Defined in header
<experimental/ranges/algorithm> Defined in namespace
std::experimental::ranges::tag [edit] Iterators
Defined in header
<experimental/ranges/iterator> Defined in namespace
std::experimental::ranges Iterator concepts
specifies that a
(concept) [edit]
Semiregular type can be incremented with pre- and post-increment operators (concept) [edit]
specifies that the increment operation on a
(concept) [edit]
WeaklyIncrementable type is equality-preserving and that the type is EqualityComparable (concept) [edit]
specifies that the
(concept) [edit]
- operator can be applied to an iterator and a sentinel to calculate their difference in constant time (concept) [edit]
specifies that a type is an input iterator, that is, its referenced values can be read and it can be both pre- and post-incremented
(concept) [edit]
(concept) [edit]
specifies that a type is an output iterator for a given value type, that is, values of that type can be written to it and it can be both pre- and post-incremented
(concept) [edit]
(concept) [edit]
specifies that an
(concept) [edit]
InputIterator is a forward iterator, supporting equality comparison and multi-pass (concept) [edit]
specifies that a
(concept) [edit]
ForwardIterator is a bidirectional iterator, supporting movement backwards (concept) [edit]
specifies that a
(concept) [edit]
BidirectionalIterator is a random-access iterator, supporting advancement in constant time and subscripting (concept) [edit]
Indirect callable concepts
specifies that a callable type can be invoked with the result of dereferencing a
(concept) [edit]
Readable type (concept) [edit]
specifies that a callable object, when invoked with the result of dereferencing a
(concept) [edit]
Readable type, satisfies Predicate (concept) [edit]
specifies that a callable object, when invoked with the result of dereferencing some
(concept) [edit]
Readable types, satisfies Relation (concept) [edit]
specifies that a callable object, when invoked with the result of dereferencing some
(concept) [edit]
Readable types, satisfies StrictWeakOrder (concept) [edit]
Common algorithm requirements
specifies that values may be moved from a
(concept) [edit]
Readable type to a Writable type and that the move may be performed via an intermediate object (concept) [edit]
specifies that values may be copied from a
(concept) [edit]
Readable type to a Writable type and that the copy may be performed via an intermediate object (concept) [edit]
specifies the requirements of algorithms that merge sorted sequences into an output sequence by copying elements
(concept) [edit]
(concept) [edit]
specifies the common requirements of algorithms that permute sequences into ordered sequences
(concept) [edit]
(concept) [edit]
Concept utilities
compute the result of invoking a callable object on the result of dereferencing some set of
(class template) [edit]
Readable types (class template) [edit]
helper template for specifying the constraints on algorithms that accept projections
(class template) [edit]
(class template) [edit]
Iterator primitives
Iterator utilities
Defined in namespace
std::experimental::ranges
casts the result of dereferencing an object to its associated rvalue reference type
(customization point object)[edit]
(customization point object)[edit]
Iterator traits
Defined in namespace
std::experimental::ranges Defined in namespace
std::experimental::ranges std::iterator_traits specializations
Defined in namespace
std Iterator operations
Defined in namespace
std::experimental::ranges
returns the distance between an iterator and a sentinel, or between the beginning and the end of a range
(function template) [edit]
(function template) [edit]
Iterator adaptors
Defined in namespace
std::experimental::ranges
adapt an iterator-sentinel pair into a common iterator type for use with legacy algorithms
(class template) [edit]
(class template) [edit]
iterator adaptor that keeps track of its distance from its starting position
(class template) [edit]
(class template) [edit]
Stream iterators
Defined in namespace
std::experimental::ranges [edit] Ranges
Defined in header
<experimental/ranges/range> Range concepts
specifies that a type is a range, that is, it provides a
(concept) [edit]
begin iterator and an end sentinel (concept) [edit]
specifies that a range is a view, that is, it has constant time copy/move/assignment
(concept) [edit]
(concept) [edit]
Range access
Defined in namespace
std::experimental::ranges Range primitives
Defined in namespace
std::experimental::ranges
obtains the size of a range whose size can be calculated in constant time
(customization point object)[edit]
(customization point object)[edit]
[edit] Algorithms
Defined in header
<experimental/ranges/algorithm> Non-modifying sequence operations
Defined in namespace
std::experimental::ranges
checks if a predicate is true for all, any or none of the elements in a range
(function template) [edit]
(function template) [edit]
finds the first two adjacent items that are equal (or satisfy a given predicate)
(function template) [edit]
(function template) [edit]
Modifying sequence operations
Defined in namespace
std::experimental::ranges
copies a range, replacing elements satisfying specific criteria with another value
(function template) [edit]
(function template) [edit]
creates a copy of some range of elements that contains no consecutive duplicates
(function template) [edit]
(function template) [edit]
Partitioning operations
Defined in namespace
std::experimental::ranges Sorting operations
Defined in namespace
std::experimental::ranges
partially sorts the given range making sure that it is partitioned by the given element
(function template) [edit]
(function template) [edit]
Binary search operations (on sorted ranges)
Defined in namespace
std::experimental::ranges Set operations (on sorted ranges)
Defined in namespace
std::experimental::ranges Heap operations
Defined in namespace
std::experimental::ranges Minimum/maximum operations
Defined in namespace
std::experimental::ranges Permutation operations
Defined in namespace
std::experimental::ranges
generates the next greater lexicographic permutation of a range of elements
(function template) [edit]
(function template) [edit]
generates the next smaller lexicographic permutation of a range of elements
(function template) [edit]
(function template) [edit]