Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/experimental/ranges"

From cppreference.com
m (thanks for starting this, TC! (also, the TS has a number: http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=70910 ))
(Concepts: text description, hopefully I got them right...)
Line 15: Line 15:
 
{{dsc namespace |std::experimental::ranges}}
 
{{dsc namespace |std::experimental::ranges}}
 
{{dsc h2 | Core language concepts}}
 
{{dsc h2 | Core language concepts}}
{{dsc rconcept | cpp/experimental/ranges/concepts/Same}}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Same | Specifies that a type is the same as another type}}
{{dsc rconcept | cpp/experimental/ranges/concepts/DerivedFrom }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/DerivedFrom | Specifies that a type is derived from another type}}
{{dsc rconcept | cpp/experimental/ranges/concepts/ConvertibleTo | }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/ConvertibleTo | Specifies that a type is implicitly convertible to another type}}
{{dsc rconcept | cpp/experimental/ranges/concepts/CommonReference| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/CommonReference| Specifies that two types share a common reference type}}
{{dsc rconcept | cpp/experimental/ranges/concepts/Common | }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Common | Specifies that two types share a common type}}
{{dsc rconcept | cpp/experimental/ranges/concepts/Integral | }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Integral | Specifies that a type is an integral type}}
{{dsc rconcept | cpp/experimental/ranges/concepts/SignedIntegral | }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/SignedIntegral | Specifies that a type is a signed integral type}}
{{dsc rconcept | cpp/experimental/ranges/concepts/UnsignedIntegral | }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/UnsignedIntegral | Specifies that a type is an integral type but not a signed integral type<!-- not using "unsigned" is intentional-->}}
{{dsc rconcept | cpp/experimental/ranges/concepts/Assignable | }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Assignable | Specifies that a type is assignable from another type}}
{{dsc rconcept | cpp/experimental/ranges/concepts/Swappable | }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Swappable | Specifies that a type can be swapped or that two types can be swapped with each other}}
 
{{dsc h2 | Comparison concepts}}
 
{{dsc h2 | Comparison concepts}}
{{dsc rconcept | cpp/experimental/ranges/concepts/Boolean | }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Boolean | Specifies that a type can be used in Boolean contexts}}
{{dsc rconcept | cpp/experimental/ranges/concepts/EqualityComparable | title=WeaklyEqualityComparable<br />EqualityComparable | }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/WeaklyEqualityComparable| title=WeaklyEqualityComparable |Specifies that two types can be compared for equality using operators {{c|1===}} and {{c|1=!=}}  }}
{{dsc rconcept | cpp/experimental/ranges/concepts/StrictTotallyOrdered | }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/EqualityComparable | title=EqualityComparable |Specifies that operator {{c|1===}} is an equivalence relation }}
 +
{{dsc rconcept | cpp/experimental/ranges/concepts/StrictTotallyOrdered | specifies that the comparison operators on the type yield a total order}}
 
{{dsc h2 | Object concepts}}
 
{{dsc h2 | Object concepts}}
{{dsc rconcept | cpp/experimental/ranges/concepts/Destructible| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Destructible| Specifies that an object of the type can be destroyed and have its address taken with unary {{c|&}} }}
{{dsc rconcept | cpp/experimental/ranges/concepts/Constructible| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Constructible| Specifies that a variable of the type can be constructed from or bound to a set of argument types }}
{{dsc rconcept | cpp/experimental/ranges/concepts/DefaultConstructible| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/DefaultConstructible| Specifies that an object of a type can be default constructed }}
{{dsc rconcept | cpp/experimental/ranges/concepts/MoveConstructible| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/MoveConstructible|Specifies that an object of a type can be move constructed}}
{{dsc rconcept | cpp/experimental/ranges/concepts/CopyConstructible| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/CopyConstructible|Specifies that an object of a type can be copy constructed and move constructed  }}
{{dsc rconcept | cpp/experimental/ranges/concepts/Movable| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Movable|Specifies that an object of a type can be moved and swapped}}
{{dsc rconcept | cpp/experimental/ranges/concepts/Copyable| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Copyable|Specifies that an object of a type can be copied, moved, and swapped }}
{{dsc rconcept | cpp/experimental/ranges/concepts/Semiregular| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Semiregular| Specifies that an object of a type can be copied, moved, swapped, and default constructed}}
{{dsc rconcept | cpp/experimental/ranges/concepts/Regular| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Regular| Specifies that a type is regular, that is, it is both {{rconcept|Semiregular}} and {{rconcept|EqualityComparable}} }}
 
{{dsc h2 | Callable concepts}}
 
{{dsc h2 | Callable concepts}}
{{dsc rconcept | cpp/experimental/ranges/concepts/Invocable|title=Invocable<br/>RegularInvocable }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Invocable|title=Invocable<br/>RegularInvocable |Specifies that a callable type can be invoked with a given set of argument types }}
{{dsc rconcept | cpp/experimental/ranges/concepts/Predicate| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Predicate| Specifies that a callable type is a Boolean predicate }}
{{dsc rconcept | cpp/experimental/ranges/concepts/Relation| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/Relation| Specifies that a callable type is a binary relation }}
{{dsc rconcept | cpp/experimental/ranges/concepts/StrictWeakOrder| }}
+
{{dsc rconcept | cpp/experimental/ranges/concepts/StrictWeakOrder| Specifies that a {{rconcept|Relation}} imposes a strict weak ordering }}
 
{{dsc end}}
 
{{dsc end}}
  

Revision as of 23:55, 4 December 2016

The C++ Extensions for Ranges, ISO/IEC TS 21425:XXXX, 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.

Contents

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.

Concepts

Defined in namespace std::experimental::ranges
Core language concepts
Specifies that a type is the same as another type
(concept)
Specifies that a type is derived from another type
(concept)
Specifies that a type is implicitly convertible to another type
(concept)
Specifies that two types share a common reference type
(concept)
Specifies that two types share a common type
(concept)
Specifies that a type is an integral type
(concept)
Specifies that a type is a signed integral type
(concept)
Specifies that a type is an integral type but not a signed integral type
(concept)
Specifies that a type is assignable from another type
(concept)
Specifies that a type can be swapped or that two types can be swapped with each other
(concept)
Comparison concepts
Specifies that a type can be used in Boolean contexts
(concept)
Specifies that two types can be compared for equality using operators == and !=
(concept)
Specifies that operator == is an equivalence relation
(concept)
specifies that the comparison operators on the type yield a total order
(concept)
Object concepts
Specifies that an object of the type can be destroyed and have its address taken with unary &
(concept)
Specifies that a variable of the type can be constructed from or bound to a set of argument types
(concept)
Specifies that an object of a type can be default constructed
(concept)
Specifies that an object of a type can be move constructed
(concept)
Specifies that an object of a type can be copy constructed and move constructed
(concept)
Specifies that an object of a type can be moved and swapped
(concept)
Specifies that an object of a type can be copied, moved, and swapped
(concept)
Specifies that an object of a type can be copied, moved, swapped, and default constructed
(concept)
Specifies that a type is regular, that is, it is both Semiregular and EqualityComparable
(concept)
Callable concepts
Specifies that a callable type can be invoked with a given set of argument types
(concept)
Specifies that a callable type is a Boolean predicate
(concept)
Specifies that a callable type is a binary relation
(concept)
Specifies that a Relation imposes a strict weak ordering
(concept)

General utilities

Utility components
Defined in namespace std::experimental::ranges

(customization point object)

(function template)
Function objects
Defined in namespace std::experimental::ranges

(function template)

(class template)

(class template)

(class template)

(class template)

(class template)

(class template)

(class template)
Metaprogramming and type traits
Defined in header <type_traits>
Defined in namespace std

(class template)

(class template)

(class template)
Tagged pairs and tuples
Defined in namespace std::experimental::ranges

(concept)

(concept)

(class template)

(alias template)

(function template)
Defined in header <experimental/ranges/tuple>

(alias template)

(function template)

Iterators

Iterator concepts
Defined in namespace std::experimental::ranges

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(variable template)

(concept)

(concept)

(concept)

(concept)

(concept)
Indirect callable concepts

(concept)

(concept)

(concept)

(concept)

(class template)

(class template)
Common algorithm requirements

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)
Iterator primitives
Iterator utilities
Defined in namespace std::experimental::ranges

(customization point object)

(customization point object)
Iterator traits
Defined in namespace std::experimental::ranges

(class template)

(class template)

(class template)

(alias template)

(alias template)

(alias template)

(alias template)

(class template)

(class template)
Iterator category tags
Defined in namespace std::experimental::ranges
empty class types used to indicate iterator categories
(class)
std::iterator_traits specializations
Defined in namespace std
Specializes std::iterator_traits for ranges TS iterators
(class template specialization)
Iterator operations
Defined in namespace std::experimental::ranges

(function template)

(function template)

(function template)

(function template)
Iterator adaptors
Defined in namespace std::experimental::ranges

(class template)

(class template)

(class template)

(class template)

(class template)

(class template)

(class template)

(class template)

(class)

(class template)

(alias template)

(class)
Stream iterators
Defined in namespace std::experimental::ranges

(class template)

(class template)

(class template)

(class template)
Range concepts
Defined in namespace std::experimental::ranges

(alias template)

(alias template)

(concept)

(concept)

(variable template)

(class)

(class template)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)
Range access
Defined in namespace std::experimental::ranges

(customization point object)

(customization point object)

(customization point object)

(customization point object)

(customization point object)

(customization point object)

(customization point object)

(customization point object)
Range primitives
Defined in namespace std::experimental::ranges

(function template)

(customization point object)

(customization point object)

(customization point object)

(customization point object)

Algorithms

Tag specifiers
Defined in namespace std::experimental::ranges::tag
Tag specifiers for use with ranges::tagged
(class)
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)
applies a function to a range of elements
(function template)
returns the number of elements satisfying specific criteria
(function template)
finds the first position where two ranges differ
(function template)
determines if two sets of elements are the same
(function template)
finds the first element satisfying specific criteria
(function template)
finds the last sequence of elements in a certain range
(function template)
searches for any one of a set of elements
(function template)
finds the first two adjacent items that are equal (or satisfy a given predicate)
(function template)
searches for a range of elements
(function template)
searches for a number consecutive copies of an element in a range
(function template)
Modifying sequence operations
Defined in namespace std::experimental::ranges
copies a range of elements to a new location
(function template)
copies a number of elements to a new location
(function template)
copies a range of elements in backwards order
(function template)
moves a range of elements to a new location
(function template)
moves a range of elements to a new location in backwards order
(function template)
assigns a range of elements a certain value
(function template)
assigns a value to a number of elements
(function template)
applies a function to a range of elements
(function template)
saves the result of a function in a range
(function template)
saves the result of N applications of a function
(function template)
removes elements satisfying specific criteria
(function template)
copies a range of elements omitting those that satisfy specific criteria
(function template)
replaces all values satisfying specific criteria with another value
(function template)
copies a range, replacing elements satisfying specific criteria with another value
(function template)
swaps two ranges of elements
(function template)
reverses the order of elements in a range
(function template)
creates a copy of a range that is reversed
(function template)
rotates the order of elements in a range
(function template)
copies and rotate a range of elements
(function template)
randomly re-orders elements in a range
(function template)
removes consecutive duplicate elements in a range
(function template)
creates a copy of some range of elements that contains no consecutive duplicates
(function template)
Partitioning operations
Defined in namespace std::experimental::ranges
determines if the range is partitioned by the given predicate
(function template)
divides a range of elements into two groups
(function template)
copies a range dividing the elements into two groups
(function template)
divides elements into two groups while preserving their relative order
(function template)
locates the partition point of a partitioned range
(function template)
Sorting operations
Defined in namespace std::experimental::ranges
checks whether a range is sorted into ascending order
(function template)
finds the largest sorted subrange
(function template)
sorts a range into ascending order
(function template)
sorts the first N elements of a range
(function template)
copies and partially sorts a range of elements
(function template)
sorts a range of elements while preserving order between equal elements
(function template)
partially sorts the given range making sure that it is partitioned by the given element
(function template)
Binary search operations (on sorted ranges)
Defined in namespace std::experimental::ranges
returns an iterator to the first element not less than the given value
(function template)
returns an iterator to the first element greater than a certain value
(function template)
determines if an element exists in a certain range
(function template)
returns range of elements matching a specific key
(function template)
Set operations (on sorted ranges)
Defined in namespace std::experimental::ranges
merges two sorted ranges
(function template)
merges two ordered ranges in-place
(function template)
returns true if one set is a subset of another
(function template)
computes the difference between two sets
(function template)
computes the intersection of two sets
(function template)
computes the symmetric difference between two sets
(function template)
computes the union of two sets
(function template)
Heap operations
Defined in namespace std::experimental::ranges
checks if the given range is a max heap
(function template)
finds the largest subrange that is a max heap
(function template)
creates a max heap out of a range of elements
(function template)
adds an element to a max heap
(function template)
removes the largest element from a max heap
(function template)
turns a max heap into a range of elements sorted in ascending order
(function template)
Minimum/maximum operations
Defined in namespace std::experimental::ranges
returns the greater of the given values
(function template)
returns the largest element in a range
(function template)
returns the smaller of the given values
(function template)
returns the smallest element in a range
(function template)
returns the smaller and larger of two elements
(function template)
returns the smallest and the largest elements in a range
(function template)
returns true if one range is lexicographically less than another
(function template)
determines if a sequence is a permutation of another sequence
(function template)
generates the next greater lexicographic permutation of a range of elements
(function template)
generates the next smaller lexicographic permutation of a range of elements
(function template)

Random number generator concept

Defined in header <experimental/ranges/random>
Defined in namespace std::experimental::ranges

(concept)