非修改序列操作
函数名 | 作用 |
---|---|
all_of() | 在一个区间内判断元素是否满足某情况,返回bool |
any_of() | |
none_of() | |
for_each() | 对每个元素应用一个function |
for_each_n() | |
count() | 返回满足特点条件的元素数量 |
count_if() | |
mismatch() | 返回两格范围内第一个不同元素的位置 |
find() | 查找第一个满足特定条件的元素位置 |
find_if() | |
find_if_not() | |
find_end() | 返回最后一次出现匹配序列的位置 |
find_first_of() | |
adjacent_find() | |
search() | 查找一定范围内的元素 |
search_n() |
修改序列操作
函数名 | 作用 |
---|---|
copy() | 拷贝一定元素到新位置 |
copy_if() | |
copy_n() | |
copy_backward() | |
move() | 移动 底层调用std::move() |
move_backward() | |
fill() | 对容器进行填充 |
transform() | 同for_each() |
generate() | 不太清楚 |
generate_n() | |
remove() | |
remove_if() | |
remove_copy() | 移除某元素 |
remove_copy_if() | |
replease() | 替换某元素 |
replease_if() | |
replease_copy() | |
replease_copy_if() | |
swap() | |
swap_ranges() | 交换指定范围内的元素 |
iter_swap() | 交换指针 |
reverse() | 反转 |
reverse() | 指定范围内反转 |
reverse_copy() | 反转并生成拷贝 |
shift_letf() | 左移元素 |
shift_right() | 右移元素 |
random_shuffle() | 在一定范围内打乱元素顺序 |
sample() | 从序列中随机选取元素 |
unique() | 返回一个元素不重复的序列 |
unique_copy() | 实现方法去看以 |
分区操作
函数名 | 作用 |
---|---|
is_partitioned() | |
partition() | |
partition_copy() | |
stable_partition() | |
partition_point() |
排序操作
函数名 | 作用 |
---|---|
is_soretd() | |
is_sorted_until() | |
sort() | |
partial_sort() | |
partial_sort_copy() | |
stable_sort() | |
nth_element() |
二进制搜索
函数名 | 作用 |
---|---|
lower_bound() | |
upper_bound() | |
binary_search() | |
equal_range() |
排序其他操作
函数名函数名 | 函数名 |
---|---|
merge() | 合并 |
inplace_merge() |
Set 操作
函数名 | 函数名 |
---|---|
includes() | |
set_difference() | |
set_intersection() | |
set_symmetric_difference() | |
set_union() |
Heap 操作
函数名 | 作用 |
---|---|
is_heap() | |
is_heap_until() | |
make_heap() | |
push_heap() | |
pop_heap() | |
sort_heap() |