std::experimental::ranges::sort
Min standard notice:
Header: <experimental/ranges/algorithm>
- Sorts the elements in the range [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.
# Declarations
template< RandomAccessIterator I, Sentinel<I> S,
class Comp = ranges::less<>, class Proj = ranges::identity >
requires Sortable<I, Comp, Proj>
I sort( I first, S last, Comp comp = Comp{}, Proj proj = Proj{} );
(ranges TS)
template< RandomAccessRange R,
class Comp = ranges::less<>, class Proj = ranges::identity >
requires Sortable<ranges::iterator_t<R>, Comp, Proj>
ranges::safe_iterator_t<R> sort( R&& r, Comp comp = Comp{}, Proj proj = Proj{} );
(ranges TS)
# Parameters
first, last: the range of elements to sortr: the range of elements to sortcomp: the comparator to useproj: 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)).
# Example
This section is incompleteReason: no example