|
|
| rb_tree () |
| | 默认构造函数
|
| | rb_tree (const Compare &comp) |
| | 构造函数,指定比较函数
|
| | rb_tree (const rb_tree &other) |
| | 拷贝构造函数
|
| rb_tree & | operator= (const rb_tree &other) |
| | 拷贝赋值运算符
|
| | rb_tree (rb_tree &&other) noexcept(is_nothrow_move_constructible_v< Compare > &&is_nothrow_move_constructible_v< KeyOfValue > &&is_nothrow_move_constructible_v< allocator_type >) |
| | 移动构造函数
|
| rb_tree & | operator= (rb_tree &&other) noexcept(is_nothrow_move_constructible_v< rb_tree >) |
| | 移动赋值运算符
|
|
| ~rb_tree () |
| | 析构函数
|
| iterator | begin () noexcept |
| | 获取起始迭代器
|
| iterator | end () noexcept |
| | 获取结束迭代器
|
| const_iterator | begin () const noexcept |
| | 获取常量起始迭代器
|
| const_iterator | end () const noexcept |
| | 获取常量结束迭代器
|
| const_iterator | cbegin () const noexcept |
| | 获取常量起始迭代器
|
| const_iterator | cend () const noexcept |
| | 获取常量结束迭代器
|
| reverse_iterator | rbegin () noexcept |
| | 获取反向起始迭代器
|
| reverse_iterator | rend () noexcept |
| | 获取反向结束迭代器
|
| const_reverse_iterator | rbegin () const noexcept |
| | 获取常量反向起始迭代器
|
| const_reverse_iterator | rend () const noexcept |
| | 获取常量反向结束迭代器
|
| const_reverse_iterator | crbegin () const noexcept |
| | 获取常量反向起始迭代器
|
| const_reverse_iterator | crend () const noexcept |
| | 获取常量反向结束迭代器
|
| size_type | size () const noexcept |
| | 获取元素数量
|
| size_type | max_size () const noexcept |
| | 获取最大可能大小
|
| bool | empty () const noexcept |
| | 检查是否为空
|
| Compare | key_compare () const noexcept(is_nothrow_copy_constructible_v< Compare >) |
| | 获取键比较函数对象
|
| template<typename... Args> |
| pair< iterator, bool > | emplace_unique (Args &&... args) |
| | 在树中构造元素(唯一键版本)
|
| pair< iterator, bool > | insert_unique (const value_type &value) |
| | 插入元素(唯一键版本)
|
| pair< iterator, bool > | insert_unique (value_type &&value) |
| | 移动插入元素(唯一键版本)
|
| template<typename... Args> |
| iterator | emplace_unique_hint (iterator position, Args &&... args) |
| | 在提示位置附近构造元素(唯一键版本)
|
| iterator | insert_unique (iterator position, const value_type &value) |
| | 在提示位置附近插入元素(唯一键版本)
|
| iterator | insert_unique (iterator position, value_type &&value) |
| | 在提示位置附近移动插入元素(唯一键版本)
|
| template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0> |
| void | insert_unique (Iterator first, Iterator last) |
| | 范围插入元素(唯一键版本)
|
| template<typename... Args> |
| iterator | emplace_equal (Args &&... args) |
| | 在树中构造元素(允许重复键版本)
|
| iterator | insert_equal (const value_type &value) |
| | 插入元素(允许重复键版本)
|
| iterator | insert_equal (value_type &&value) |
| | 移动插入元素(允许重复键版本)
|
| template<typename... Args> |
| iterator | emplace_equal_hint (iterator position, Args &&... args) |
| | 在提示位置附近构造元素(允许重复键版本)
|
| iterator | insert_equal (iterator position, const value_type &value) |
| | 在提示位置附近插入元素(允许重复键版本)
|
| iterator | insert_equal (iterator position, value_type &&value) |
| | 在提示位置附近移动插入元素(允许重复键版本)
|
| template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0> |
| void | insert_equal (Iterator first, Iterator last) |
| | 范围插入元素(允许重复键版本)
|
| size_type | erase (const key_type &key) noexcept(is_nothrow_destructible_v< link_node >) |
| | 删除所有具有指定键的元素
|
| void | erase (iterator position) noexcept(is_nothrow_destructible_v< link_node >) |
| | 删除指定位置的元素
|
| void | erase (iterator first, iterator last) noexcept(is_nothrow_destructible_v< link_node >) |
| | 删除指定范围内的元素
|
|
void | clear () noexcept(is_nothrow_destructible_v< link_node >) |
| | 清空树
|
| iterator | find (const key_type &key) |
| | 查找具有指定键的元素
|
| const_iterator | find (const key_type &key) const |
| | 查找具有指定键的元素(常量版本)
|
| size_type | count (const key_type &key) const |
| | 统计具有指定键的元素数量
|
| iterator | lower_bound (const key_type &key) |
| | 获取第一个不小于指定键的元素位置
|
| const_iterator | lower_bound (const key_type &key) const |
| | 获取第一个不小于指定键的元素位置(常量版本)
|
| iterator | upper_bound (const key_type &key) |
| | 获取第一个大于指定键的元素位置
|
| const_iterator | upper_bound (const key_type &key) const |
| | 获取第一个大于指定键的元素位置(常量版本)
|
| pair< iterator, iterator > | equal_range (const key_type &key) |
| | 获取等于指定键的元素范围
|
| pair< const_iterator, const_iterator > | equal_range (const key_type &key) const |
| | 获取等于指定键的元素范围(常量版本)
|
| void | swap (rb_tree &other) noexcept(is_nothrow_swappable_v< Compare > &&is_nothrow_swappable_v< KeyOfValue > &&is_nothrow_swappable_v< allocator_type >) |
| | 交换两个红黑树的内容
|
| bool | equal_to (const rb_tree &rhs) const noexcept(noexcept(_NEFORCE equal(cbegin(), cend(), rhs.cbegin()))) |
| | 相等比较操作符
|
| bool | less_than (const rb_tree &rhs) const noexcept(noexcept(_NEFORCE lexicographical_compare(cbegin(), cend(), rhs.cbegin(), rhs.cend()))) |
| | 小于比较操作符
|
template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
class rb_tree< Key, Value, KeyOfValue, Compare, Alloc >
红黑树容器
- 模板参数
-
| Key | 键类型 |
| Value | 值类型 |
| KeyOfValue | 从值中提取键的函数对象 |
| Compare | 键比较函数对象 |
| Alloc | 分配器类型 |
红黑树是一种自平衡二叉搜索树,作为关联式容器的底层实现。
在文件 rb_tree.hpp 第 619 行定义.
template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
template<typename... Args>
| iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::emplace_equal |
( |
Args &&... | args | ) |
|
|
inline |
在树中构造元素(允许重复键版本)
- 模板参数
-
- 参数
-
- 返回
- 指向插入元素的迭代器
在文件 rb_tree.hpp 第 1239 行定义.
被这些函数引用 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::insert_equal() , 以及 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::insert_equal().
template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
template<typename... Args>
| iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::emplace_equal_hint |
( |
iterator | position, |
|
|
Args &&... | args ) |
|
inline |
在提示位置附近构造元素(允许重复键版本)
- 模板参数
-
- 参数
-
- 返回
- 指向插入元素的迭代器
在文件 rb_tree.hpp 第 1266 行定义.
被这些函数引用 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::insert_equal() , 以及 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::insert_equal().
template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
template<typename... Args>
| pair< iterator, bool > rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::emplace_unique |
( |
Args &&... | args | ) |
|
|
inline |
在树中构造元素(唯一键版本)
- 模板参数
-
- 参数
-
- 返回
- 插入结果(迭代器和是否成功)
在文件 rb_tree.hpp 第 1131 行定义.
被这些函数引用 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::insert_unique() , 以及 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::insert_unique().
template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
template<typename... Args>
| iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::emplace_unique_hint |
( |
iterator | position, |
|
|
Args &&... | args ) |
|
inline |
在提示位置附近构造元素(唯一键版本)
- 模板参数
-
- 参数
-
- 返回
- 指向插入元素的迭代器
在文件 rb_tree.hpp 第 1158 行定义.
被这些函数引用 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::insert_unique() , 以及 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::insert_unique().
template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
获取等于指定键的元素范围
- 参数
-
- 返回
- 包含lower_bound和upper_bound的pair
在文件 rb_tree.hpp 第 1543 行定义.
被这些函数引用 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::count() , 以及 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::erase().
template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
获取第一个不小于指定键的元素位置
- 参数
-
- 返回
- 指向第一个不小于key的元素的迭代器
在文件 rb_tree.hpp 第 1459 行定义.
被这些函数引用 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::equal_range() , 以及 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::equal_range().
template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
| void rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::swap |
( |
rb_tree< Key, Value, KeyOfValue, Compare, Alloc > & | other | ) |
|
|
inlinenoexcept |
交换两个红黑树的内容
- 参数
-
在文件 rb_tree.hpp 第 1560 行定义.
被这些函数引用 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::operator=() , 以及 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::operator=().