cpp/algorithm/ranges/sort

Sorts the elements in the range in non-descending order. The order of equivalent elements is not guaranteed to be preserved.

A sequence is sorted with respect to a comparator if for any iterator  pointing to the sequence and any non-negative integer  such that  is a valid iterator pointing to an element of the sequence,  evaluates to.

@1@ Elements are compared using the given binary comparison function. @2@ Same as, but uses as the source range, as if using  as  and  as.

Return value
An iterator equal to.

Complexity
comparisons and projections, where.

Possible implementation
Note that typical implementations use. See also the implementation in MSVC STL and libstdc++.