Namespaces
Variants
Views
Actions

std::sortable

From cppreference.com
< cpp‎ | iterator
 
 
Iterator library
Iterator concepts
Iterator primitives
Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
(C++20)
(C++20)
sortable
(C++20)
Utilities
Iterator adaptors
Stream iterators
Iterator customization points
Iterator operations
(C++11)
(C++11)
Range access
(C++11)(C++14)
(C++11)(C++14)
(C++17)(C++20)
(C++14)(C++14)
(C++14)(C++14)
(C++17)
(C++17)
 
Defined in header <iterator>
template< class I, class R = ranges::less, class P = std::identity >

concept sortable =
    std::permutable<I> &&

    std::indirect_strict_weak_order<R, std::projected<I, P>>;
(since C++20)

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

[edit] Semantic requirements

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

[edit] See also

sorts a range into ascending order
(niebloid) [edit]
sorts a range of elements while preserving order between equal elements
(niebloid) [edit]
sorts the first N elements of a range
(niebloid) [edit]
partially sorts the given range making sure that it is partitioned by the given element
(niebloid) [edit]
merges two ordered ranges in-place
(niebloid) [edit]
adds an element to a max heap
(niebloid) [edit]
removes the largest element from a max heap
(niebloid) [edit]
creates a max heap out of a range of elements
(niebloid) [edit]
turns a max heap into a range of elements sorted in ascending order
(niebloid) [edit]
generates the next greater lexicographic permutation of a range of elements
(niebloid) [edit]
generates the next smaller lexicographic permutation of a range of elements
(niebloid) [edit]