|
| | flat_unordered_set ()=default |
| | 默认构造函数
|
| | flat_unordered_set (const size_type n) |
| | 构造函数,指定初始容量
|
| | flat_unordered_set (const size_type n, const hasher &hf) |
| | 构造函数,指定初始容量和哈希函数
|
| | flat_unordered_set (const size_type n, const hasher &hf, const key_equal &eql) |
| | 构造函数,指定初始容量、哈希函数和键相等比较函数
|
| | flat_unordered_set (const flat_unordered_set &other) |
| | 拷贝构造函数
|
| flat_unordered_set & | operator= (const flat_unordered_set &other) |
| | 拷贝赋值运算符
|
| | flat_unordered_set (flat_unordered_set &&other) noexcept(is_nothrow_move_constructible_v< base_type >) |
| | 移动构造函数
|
| flat_unordered_set & | operator= (flat_unordered_set &&other) noexcept(is_nothrow_move_assignable_v< base_type >) |
| | 移动赋值运算符
|
| template<typename Iterator> |
| | flat_unordered_set (Iterator first, Iterator last) |
| | 范围构造函数
|
| template<typename Iterator> |
| | flat_unordered_set (Iterator first, Iterator last, const size_type n) |
| | 范围构造函数,指定初始容量
|
| template<typename Iterator> |
| | flat_unordered_set (Iterator first, Iterator last, const size_type n, const hasher &hf) |
| | 范围构造函数,指定初始容量和哈希函数
|
| template<typename Iterator> |
| | flat_unordered_set (Iterator first, Iterator last, const size_type n, const hasher &hf, const key_equal &eql) |
| | 范围构造函数,指定初始容量、哈希函数和键相等比较函数
|
| | flat_unordered_set (std::initializer_list< value_type > ilist) |
| | 初始化列表构造函数
|
| | flat_unordered_set (std::initializer_list< value_type > ilist, const size_type n) |
| | 初始化列表构造函数,指定初始容量
|
| | flat_unordered_set (std::initializer_list< value_type > ilist, const size_type n, const hasher &hf) |
| | 初始化列表构造函数,指定初始容量和哈希函数
|
| | flat_unordered_set (std::initializer_list< value_type > ilist, const size_type n, const hasher &hf, const key_equal &eql) |
| | 初始化列表构造函数,指定初始容量、哈希函数和键相等比较函数
|
| 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 |
| | 获取常量结束迭代器
|
| size_type | size () const noexcept |
| | 获取元素数量
|
| size_type | max_size () const noexcept |
| | 获取最大可能大小
|
| bool | empty () const noexcept |
| | 检查是否为空
|
| size_type | capacity () const noexcept |
| | 获取容量
|
| size_type | count (const key_type &key) const noexcept(noexcept(ht_.count(key))) |
| | 统计具有指定键的元素数量
|
| bool | contains (const key_type &key) const noexcept(noexcept(ht_.contains(key))) |
| | 检查是否包含指定键
|
| hasher | hash_function () const noexcept(noexcept(ht_.hash_function())) |
| | 获取哈希函数对象
|
| key_equal | key_eql () const noexcept(noexcept(ht_.key_eql())) |
| | 获取键相等比较函数对象
|
| float | load_factor () const noexcept |
| | 获取当前负载因子
|
| float | max_load_factor () const noexcept |
| | 获取最大负载因子
|
| void | max_load_factor (const float lf) noexcept |
| | 设置最大负载因子
|
| void | rehash (const size_type n) |
| | 重新哈希,调整容量
|
| void | reserve (const size_type n) |
| | 预留空间
|
| template<typename... Args> |
| pair< iterator, bool > | emplace (Args &&... args) |
| | 在容器中就地构造元素
|
| pair< iterator, bool > | insert (const value_type &value) |
| | 插入元素(拷贝版本)
|
| pair< iterator, bool > | insert (value_type &&value) |
| | 移动插入元素
|
| template<typename Iterator> |
| void | insert (Iterator first, Iterator last) |
| | 范围插入元素
|
| void | insert (std::initializer_list< value_type > ilist) |
| | 初始化列表插入元素
|
| size_type | erase (const key_type &key) noexcept |
| | 删除所有具有指定键的元素
|
| iterator | erase (const iterator position) noexcept |
| | 删除指定位置的元素
|
| iterator | erase (const iterator first, const iterator last) noexcept |
| | 删除指定范围内的元素
|
| const_iterator | erase (const const_iterator position) noexcept |
| | 删除指定位置的常量元素
|
| const_iterator | erase (const const_iterator first, const const_iterator last) noexcept |
| | 删除指定范围内的常量元素
|
|
void | clear () noexcept |
| | 清空容器
|
| iterator | find (const key_type &key) |
| | 查找具有指定键的元素
|
| const_iterator | find (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 (flat_unordered_set &other) noexcept(is_nothrow_swappable_v< base_type >) |
| | 交换两个容器
|
| bool | equal_to (const flat_unordered_set &rhs) const noexcept(noexcept(ht_==rhs.ht_)) |
| | 相等比较操作符
|
| bool | less_than (const flat_unordered_set &rhs) const noexcept(noexcept(ht_< rhs.ht_)) |
| | 小于比较操作符
|
| constexpr decltype(auto) | size () const noexcept(noexcept(derived().size())) |
| | 获取集合大小
|
| constexpr bool | empty () const noexcept(noexcept(derived().empty())) |
| | 检查集合是否为空
|
| constexpr bool | operator== (const T &rhs) const noexcept(noexcept(derived().equal_to(rhs))) |
| | 相等比较运算符
|
| constexpr bool | operator!= (const T &rhs) const noexcept(noexcept(!(derived().equal_to(rhs)))) |
| | 不等比较运算符
|
| constexpr bool | operator< (const T &rhs) const noexcept(noexcept(derived().less_than(rhs))) |
| | 小于比较运算符
|
| constexpr bool | operator> (const T &rhs) const noexcept(noexcept(rhs.less_than(derived()))) |
| | 大于比较运算符
|
| constexpr bool | operator<= (const T &rhs) const noexcept(noexcept(!(rhs.less_than(derived())))) |
| | 小于等于比较运算符
|
| constexpr bool | operator>= (const T &rhs) const noexcept(noexcept(!(derived().less_than(rhs)))) |
| | 大于等于比较运算符
|
template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
class neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >
平坦无序集合容器
- 模板参数
-
flat_unordered_set 是一种关联容器,存储唯一的键值,每个键在容器中唯一。 元素无序存储,由哈希函数将键映射到槽位。 底层使用开放寻址平坦哈希表,提供优于链地址法的缓存局部性。
在文件 flat_unordered_set.hpp 第 37 行定义.