std::ranges::stable_sort
From cppreference.com
Defined in header <algorithm>
|
||
Call signature |
||
template< std::random_access_iterator I, std::sentinel_for<I> S, class Comp = ranges::less, class Proj = std::identity > |
(1) | (since C++20) (constexpr since C++26) |
template< ranges::random_access_range R, class Comp = ranges::less, class Proj = std::identity > |
(2) | (since C++20) (constexpr since C++26) |
Sorts the elements in the range [
first,
last)
in non-descending order. The order of equivalent elements is stable, i.e. guaranteed to be preserved.
A sequence is sorted with respect to a comparator comp if for any iterator it
pointing to the sequence and any non-negative integer n
such that it + n
is a valid iterator pointing to an element of the sequence, std::invoke(comp,