Namespaces
Variants

std:: sortable

From zh.cppreference.net
Iterator library
Iterator concepts
Iterator primitives
Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
(C++20)
(C++20)
sortable
(C++20)
Utilities
(C++20)
Iterator adaptors
Range access
(C++11) (C++14)
(C++14) (C++14)
(C++11) (C++14)
(C++14) (C++14)
(C++17) (C++20)
(C++17)
(C++17)
定义于头文件 <iterator>
template < class I, class Comp = ranges:: less , class Proj = std:: identity >

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

std:: indirect_strict_weak_order < Comp, std :: projected < I, Proj >> ;
(C++20 起)

sortable 概念规定了算法需满足的要求,这些算法根据 Comp 将范围排列成有序范围。

语义要求

std :: sortable < I, Comp, Proj > 仅当其所包含的所有概念均被满足时才被建模。

参见

对范围内的元素进行排序
(算法函数对象)
对范围内的元素进行排序,同时保持等价元素之间的相对顺序
(算法函数对象)
对范围内前 N 个元素进行排序
(算法函数对象)
找到对范围进行排序后的第 N 个元素
(算法函数对象)
原地合并两个有序范围
(算法函数对象)
向最大堆添加元素
(算法函数对象)
从最大堆移除最大元素
(算法函数对象)
从一系列元素中创建最大堆
(算法函数对象)
将最大堆转换为已排序的元素范围
(算法函数对象)
生成一系列元素的下一个更大的字典序排列
(算法函数对象)
生成一系列元素的下一个更小的字典序排列
(算法函数对象)