Scroll to navigation

std::sortable(3) C++ Standard Libary std::sortable(3)

NAME

std::sortable - std::sortable

Synopsis

Defined in header <iterator> template< class I, class Comp = ranges::less, class Proj = std::identity >

concept sortable = (since C++20) std::permutable<I> &&

std::indirect_strict_weak_order<Comp, std::projected<I, Proj>>;

The sortable concept specifies the requirements for algorithms that permute a range into an ordered range according to Comp.


Semantic requirements

std::sortable<I, Comp, Proj> is modeled only if all concepts it subsumes are modeled.

See also

ranges::sort sorts a range into ascending order (C++20) (algorithm function object) ranges::stable_sort sorts a range of elements while preserving order between equal (C++20) elements
(algorithm function object) ranges::partial_sort sorts the first N elements of a range (C++20) (algorithm function object) ranges::nth_element partially sorts the given range making sure that it is (C++20) partitioned by the given element
(algorithm function object) ranges::inplace_merge merges two ordered ranges in-place (C++20) (algorithm function object) ranges::push_heap adds an element to a max heap (C++20) (algorithm function object) ranges::pop_heap removes the largest element from a max heap (C++20) (algorithm function object) ranges::make_heap creates a max heap out of a range of elements (C++20) (algorithm function object) ranges::sort_heap turns a max heap into a range of elements sorted in ascending (C++20) order
(algorithm function object) ranges::next_permutation generates the next greater lexicographic permutation of a range (C++20) of elements
(algorithm function object) ranges::prev_permutation generates the next smaller lexicographic permutation of a range (C++20) of elements
(algorithm function object)

2026.11.10 http://cppreference.com