std::experimental::ranges::sort
Technical Specification | ||||
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) | ||||
Experimental Non-TS | ||||
Pattern Matching | ||||
Linear Algebra | ||||
std::execution | ||||
Contracts | ||||
2D Graphics |
Non-modifying sequence operations | |||||||||||||
Modifying sequence operations | |||||||||||||
Partitioning operations | |||||||||||||
Sorting operations | |||||||||||||
|
|||||||||||||
Binary search operations | |||||||||||||
Set operations (on sorted ranges) | |||||||||||||
Heap operations | |||||||||||||
Minimum/maximum operations | |||||||||||||
Permutations | |||||||||||||
Defined in header <experimental/ranges/algorithm>
|
||
template
< RandomAccessIterator I, Sentinel<I> S,
class Comp =
ranges::less
<>, class Proj =
ranges::identity
>
|
(1) | (ranges TS) |
template
< RandomAccessRange R,
class Comp =
ranges::less
<>, class Proj =
ranges::identity
>
|
(2) | (ranges TS) |
[
first
,
last
)
in ascending order. The order of equal elements is not guaranteed to be preserved. Elements are compared using comp after applying the projection proj
Notwithstanding the declarations depicted above, the actual number and order of template parameters for algorithm declarations is unspecified. Thus, if explicit template arguments are used when calling an algorithm, the program is probably non-portable.
Parameters
first, last | - | the range of elements to sort |
r | - | the range of elements to sort |
comp | - | the comparator to use |
proj | - | the projection to apply to elements in the range |
Return value
An iterator pointing past the end of the range (i.e., it compares equal to last for overload (1), and ranges::end(r)
for overload (2)
Complexity
O(N·log(N)) comparisons, where N is equal to the number of elements in the range.
Example
This section is incomplete Reason: no example |
See also
sorts a range into ascending order (function template) |