NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
rb_tree< Key, Value, KeyOfValue, Compare, Alloc > 模板类 参考

红黑树容器 更多...

#include <rb_tree.hpp>

Public 类型

using key_type = Key
 键类型
using color_type = bool
 颜色类型
using value_type = Value
 值类型
using pointer = Value*
 指针类型
using reference = Value&
 引用类型
using const_pointer = const Value*
 常量指针类型
using const_reference = const Value&
 常量引用类型
using size_type = size_t
 大小类型
using difference_type = ptrdiff_t
 差值类型
using iterator = rb_tree_iterator<false, rb_tree>
 迭代器类型
using const_iterator = rb_tree_iterator<true, rb_tree>
 常量迭代器类型
using reverse_iterator = _NEFORCE reverse_iterator<iterator>
 反向迭代器类型
using const_reverse_iterator = _NEFORCE reverse_iterator<const_iterator>
 常量反向迭代器类型
using allocator_type = Alloc
 分配器类型

Public 成员函数

 rb_tree ()
 默认构造函数
 rb_tree (const Compare &comp)
 构造函数,指定比较函数
 rb_tree (const rb_tree &other)
 拷贝构造函数
rb_treeoperator= (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_treeoperator= (rb_tree &&other) noexcept(is_nothrow_move_constructible_v< rb_tree >)
 移动赋值运算符
 ~rb_tree ()
 析构函数
NEFORCE_NODISCARD iterator begin () noexcept
 获取起始迭代器
NEFORCE_NODISCARD iterator end () noexcept
 获取结束迭代器
NEFORCE_NODISCARD const_iterator begin () const noexcept
 获取常量起始迭代器
NEFORCE_NODISCARD const_iterator end () const noexcept
 获取常量结束迭代器
NEFORCE_NODISCARD const_iterator cbegin () const noexcept
 获取常量起始迭代器
NEFORCE_NODISCARD const_iterator cend () const noexcept
 获取常量结束迭代器
NEFORCE_NODISCARD reverse_iterator rbegin () noexcept
 获取反向起始迭代器
NEFORCE_NODISCARD reverse_iterator rend () noexcept
 获取反向结束迭代器
NEFORCE_NODISCARD const_reverse_iterator rbegin () const noexcept
 获取常量反向起始迭代器
NEFORCE_NODISCARD const_reverse_iterator rend () const noexcept
 获取常量反向结束迭代器
NEFORCE_NODISCARD const_reverse_iterator crbegin () const noexcept
 获取常量反向起始迭代器
NEFORCE_NODISCARD const_reverse_iterator crend () const noexcept
 获取常量反向结束迭代器
NEFORCE_NODISCARD size_type size () const noexcept
 获取元素数量
NEFORCE_NODISCARD size_type max_size () const noexcept
 获取最大可能大小
NEFORCE_NODISCARD bool empty () const noexcept
 检查是否为空
NEFORCE_NODISCARD 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 >)
 清空树
NEFORCE_NODISCARD iterator find (const key_type &key)
 查找具有指定键的元素
NEFORCE_NODISCARD const_iterator find (const key_type &key) const
 查找具有指定键的元素(常量版本)
NEFORCE_NODISCARD size_type count (const key_type &key) const
 统计具有指定键的元素数量
NEFORCE_NODISCARD iterator lower_bound (const key_type &key)
 获取第一个不小于指定键的元素位置
NEFORCE_NODISCARD const_iterator lower_bound (const key_type &key) const
 获取第一个不小于指定键的元素位置(常量版本)
NEFORCE_NODISCARD iterator upper_bound (const key_type &key)
 获取第一个大于指定键的元素位置
NEFORCE_NODISCARD const_iterator upper_bound (const key_type &key) const
 获取第一个大于指定键的元素位置(常量版本)
NEFORCE_NODISCARD pair< iterator, iteratorequal_range (const key_type &key)
 获取等于指定键的元素范围
NEFORCE_NODISCARD pair< const_iterator, const_iteratorequal_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 >)
 交换两个红黑树的内容
NEFORCE_NODISCARD bool operator== (const rb_tree &rhs) const noexcept(noexcept(_NEFORCE equal(cbegin(), cend(), rhs.cbegin())))
 相等比较操作符
NEFORCE_NODISCARD bool operator< (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.hpp609 行定义.

构造及析构函数说明

◆ rb_tree() [1/3]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::rb_tree ( const Compare & comp)
inlineexplicit

构造函数,指定比较函数

参数
comp比较函数对象

在文件 rb_tree.hpp946 行定义.

◆ rb_tree() [2/3]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::rb_tree ( const rb_tree< Key, Value, KeyOfValue, Compare, Alloc > & other)
inline

拷贝构造函数

参数
other源红黑树

在文件 rb_tree.hpp955 行定义.

◆ rb_tree() [3/3]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::rb_tree ( rb_tree< Key, Value, KeyOfValue, Compare, Alloc > && other)
inlinenoexcept

移动构造函数

参数
other源红黑树

在文件 rb_tree.hpp981 行定义.

成员函数说明

◆ begin() [1/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD const_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::begin ( ) const
inlinenoexcept

获取常量起始迭代器

返回
指向最小元素的常量迭代器

在文件 rb_tree.hpp1032 行定义.

◆ begin() [2/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::begin ( )
inlinenoexcept

◆ cbegin()

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD const_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::cbegin ( ) const
inlinenoexcept

◆ cend()

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD const_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::cend ( ) const
inlinenoexcept

◆ count()

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD size_type rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::count ( const key_type & key) const
inline

统计具有指定键的元素数量

参数
key要统计的键
返回
匹配的元素数量

在文件 rb_tree.hpp1438 行定义.

◆ crbegin()

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD const_reverse_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::crbegin ( ) const
inlinenoexcept

获取常量反向起始迭代器

返回
指向最大元素的常量反向迭代器

在文件 rb_tree.hpp1080 行定义.

被这些函数引用 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::rbegin().

◆ crend()

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD const_reverse_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::crend ( ) const
inlinenoexcept

获取常量反向结束迭代器

返回
指向最小元素之前位置的常量反向迭代器

在文件 rb_tree.hpp1086 行定义.

被这些函数引用 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::rend().

◆ emplace_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 ( Args &&... args)
inline

在树中构造元素(允许重复键版本)

模板参数
Args构造参数类型
参数
args构造参数
返回
指向插入元素的迭代器

在文件 rb_tree.hpp1229 行定义.

被这些函数引用 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().

◆ emplace_equal_hint()

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

在提示位置附近构造元素(允许重复键版本)

模板参数
Args构造参数类型
参数
position插入位置提示
args构造参数
返回
指向插入元素的迭代器

在文件 rb_tree.hpp1256 行定义.

被这些函数引用 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().

◆ emplace_unique()

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

在树中构造元素(唯一键版本)

模板参数
Args构造参数类型
参数
args构造参数
返回
插入结果(迭代器和是否成功)

在文件 rb_tree.hpp1121 行定义.

被这些函数引用 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().

◆ emplace_unique_hint()

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

在提示位置附近构造元素(唯一键版本)

模板参数
Args构造参数类型
参数
position插入位置提示
args构造参数
返回
指向插入元素的迭代器

在文件 rb_tree.hpp1148 行定义.

被这些函数引用 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().

◆ empty()

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD bool rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::empty ( ) const
inlinenoexcept

检查是否为空

返回
是否为空

在文件 rb_tree.hpp1104 行定义.

◆ end() [1/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD const_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::end ( ) const
inlinenoexcept

获取常量结束迭代器

返回
指向头节点的常量迭代器

在文件 rb_tree.hpp1038 行定义.

◆ end() [2/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::end ( )
inlinenoexcept

◆ equal_range() [1/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD pair< iterator, iterator > rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::equal_range ( const key_type & key)
inline

获取等于指定键的元素范围

参数
key键值
返回
包含lower_bound和upper_bound的pair

在文件 rb_tree.hpp1533 行定义.

被这些函数引用 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().

◆ equal_range() [2/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD pair< const_iterator, const_iterator > rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::equal_range ( const key_type & key) const
inline

获取等于指定键的元素范围(常量版本)

参数
key键值
返回
包含lower_bound和upper_bound的pair

在文件 rb_tree.hpp1542 行定义.

◆ erase() [1/3]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
size_type rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::erase ( const key_type & key)
inlinenoexcept

删除所有具有指定键的元素

参数
key要删除的键
返回
删除的元素数量

在文件 rb_tree.hpp1333 行定义.

被这些函数引用 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::erase() , 以及 rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::erase().

◆ erase() [2/3]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
void rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::erase ( iterator first,
iterator last )
inlinenoexcept

删除指定范围内的元素

参数
first起始迭代器
last结束迭代器

在文件 rb_tree.hpp1356 行定义.

◆ erase() [3/3]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
void rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::erase ( iterator position)
inlinenoexcept

删除指定位置的元素

参数
position要删除的位置

在文件 rb_tree.hpp1344 行定义.

◆ find() [1/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::find ( const key_type & key)
inline

查找具有指定键的元素

参数
key要查找的键
返回
指向第一个匹配元素的迭代器,未找到则返回end()

在文件 rb_tree.hpp1388 行定义.

◆ find() [2/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD const_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::find ( const key_type & key) const
inline

查找具有指定键的元素(常量版本)

参数
key要查找的键
返回
指向第一个匹配元素的常量迭代器,未找到则返回cend()

在文件 rb_tree.hpp1413 行定义.

◆ insert_equal() [1/5]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::insert_equal ( const value_type & value)
inline

插入元素(允许重复键版本)

参数
value要插入的值
返回
指向插入元素的迭代器

在文件 rb_tree.hpp1239 行定义.

◆ insert_equal() [2/5]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0>
void rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::insert_equal ( Iterator first,
Iterator last )
inline

范围插入元素(允许重复键版本)

模板参数
Iterator迭代器类型
参数
first起始迭代器
last结束迭代器

在文件 rb_tree.hpp1322 行定义.

◆ insert_equal() [3/5]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::insert_equal ( iterator position,
const value_type & value )
inline

在提示位置附近插入元素(允许重复键版本)

参数
position插入位置提示
value要插入的值
返回
指向插入元素的迭代器

在文件 rb_tree.hpp1301 行定义.

◆ insert_equal() [4/5]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::insert_equal ( iterator position,
value_type && value )
inline

在提示位置附近移动插入元素(允许重复键版本)

参数
position插入位置提示
value要插入的值
返回
指向插入元素的迭代器

在文件 rb_tree.hpp1311 行定义.

◆ insert_equal() [5/5]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::insert_equal ( value_type && value)
inline

移动插入元素(允许重复键版本)

参数
value要插入的值
返回
指向插入元素的迭代器

在文件 rb_tree.hpp1246 行定义.

◆ insert_unique() [1/5]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
pair< iterator, bool > rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::insert_unique ( const value_type & value)
inline

插入元素(唯一键版本)

参数
value要插入的值
返回
插入结果(迭代器和是否成功)

在文件 rb_tree.hpp1131 行定义.

◆ insert_unique() [2/5]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0>
void rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::insert_unique ( Iterator first,
Iterator last )
inline

范围插入元素(唯一键版本)

模板参数
Iterator迭代器类型
参数
first起始迭代器
last结束迭代器

在文件 rb_tree.hpp1216 行定义.

◆ insert_unique() [3/5]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::insert_unique ( iterator position,
const value_type & value )
inline

在提示位置附近插入元素(唯一键版本)

参数
position插入位置提示
value要插入的值
返回
指向插入元素的迭代器

在文件 rb_tree.hpp1195 行定义.

◆ insert_unique() [4/5]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::insert_unique ( iterator position,
value_type && value )
inline

在提示位置附近移动插入元素(唯一键版本)

参数
position插入位置提示
value要插入的值
返回
指向插入元素的迭代器

在文件 rb_tree.hpp1205 行定义.

◆ insert_unique() [5/5]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
pair< iterator, bool > rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::insert_unique ( value_type && value)
inline

移动插入元素(唯一键版本)

参数
value要插入的值
返回
插入结果(迭代器和是否成功)

在文件 rb_tree.hpp1138 行定义.

◆ key_compare()

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD Compare rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::key_compare ( ) const
inlinenoexcept

获取键比较函数对象

返回
键比较函数对象的副本

在文件 rb_tree.hpp1110 行定义.

◆ lower_bound() [1/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::lower_bound ( const key_type & key)
inline

获取第一个不小于指定键的元素位置

参数
key键值
返回
指向第一个不小于key的元素的迭代器

在文件 rb_tree.hpp1449 行定义.

被这些函数引用 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().

◆ lower_bound() [2/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD const_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::lower_bound ( const key_type & key) const
inline

获取第一个不小于指定键的元素位置(常量版本)

参数
key键值
返回
指向第一个不小于key的元素的常量迭代器

在文件 rb_tree.hpp1470 行定义.

◆ max_size()

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD size_type rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::max_size ( ) const
inlinenoexcept

获取最大可能大小

返回
最大元素数量

在文件 rb_tree.hpp1098 行定义.

◆ operator<()

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD bool rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::operator< ( const rb_tree< Key, Value, KeyOfValue, Compare, Alloc > & rhs) const
inlinenoexcept

小于比较操作符

参数
rhs右侧红黑树
返回
按字典序比较结果

在文件 rb_tree.hpp1573 行定义.

◆ operator=() [1/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
rb_tree & rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::operator= ( const rb_tree< Key, Value, KeyOfValue, Compare, Alloc > & other)
inline

拷贝赋值运算符

参数
other源红黑树
返回
自身引用

在文件 rb_tree.hpp968 行定义.

◆ operator=() [2/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
rb_tree & rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::operator= ( rb_tree< Key, Value, KeyOfValue, Compare, Alloc > && other)
inlinenoexcept

移动赋值运算符

参数
other源红黑树
返回
自身引用

在文件 rb_tree.hpp997 行定义.

◆ operator==()

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD bool rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::operator== ( const rb_tree< Key, Value, KeyOfValue, Compare, Alloc > & rhs) const
inlinenoexcept

相等比较操作符

参数
rhs右侧红黑树
返回
如果两个红黑树大小相等且对应元素相等返回true

在文件 rb_tree.hpp1563 行定义.

◆ rbegin() [1/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD const_reverse_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::rbegin ( ) const
inlinenoexcept

获取常量反向起始迭代器

返回
指向最大元素的常量反向迭代器

在文件 rb_tree.hpp1068 行定义.

◆ rbegin() [2/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD reverse_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::rbegin ( )
inlinenoexcept

获取反向起始迭代器

返回
指向最大元素的反向迭代器

在文件 rb_tree.hpp1056 行定义.

◆ rend() [1/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD const_reverse_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::rend ( ) const
inlinenoexcept

获取常量反向结束迭代器

返回
指向最小元素之前位置的常量反向迭代器

在文件 rb_tree.hpp1074 行定义.

◆ rend() [2/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD reverse_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::rend ( )
inlinenoexcept

获取反向结束迭代器

返回
指向最小元素之前位置的反向迭代器

在文件 rb_tree.hpp1062 行定义.

◆ size()

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD size_type rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::size ( ) const
inlinenoexcept

◆ swap()

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

◆ upper_bound() [1/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::upper_bound ( const key_type & key)
inline

获取第一个大于指定键的元素位置

参数
key键值
返回
指向第一个大于key的元素的迭代器

在文件 rb_tree.hpp1491 行定义.

被这些函数引用 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().

◆ upper_bound() [2/2]

template<typename Key, typename Value, typename KeyOfValue, typename Compare, typename Alloc = allocator<rb_tree_node<Value>>>
NEFORCE_NODISCARD const_iterator rb_tree< Key, Value, KeyOfValue, Compare, Alloc >::upper_bound ( const key_type & key) const
inline

获取第一个大于指定键的元素位置(常量版本)

参数
key键值
返回
指向第一个大于key的元素的常量迭代器

在文件 rb_tree.hpp1512 行定义.


该类的文档由以下文件生成: