NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc > 模板类 参考

平坦无序集合容器 更多...

#include <flat_unordered_set.hpp>

类 neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc > 继承关系图:
[图例]

Public 类型

using key_type = typename base_type::key_type
 键类型
using value_type = typename base_type::value_type
 值类型
using hasher = typename base_type::hasher
 哈希函数类型
using key_equal = typename base_type::key_equal
 键相等比较函数类型
using size_type = typename base_type::size_type
 大小类型
using difference_type = typename base_type::difference_type
 差值类型
using pointer = typename base_type::const_pointer
 指针类型(键即值,不可修改)
using const_pointer = typename base_type::const_pointer
 常量指针类型
using reference = typename base_type::const_reference
 引用类型(键即值,不可修改)
using const_reference = typename base_type::const_reference
 常量引用类型
using iterator = typename base_type::iterator
 迭代器类型
using const_iterator = typename base_type::const_iterator
 常量迭代器类型
using allocator_type = typename base_type::allocator_type
 分配器类型

Public 成员函数

 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_setoperator= (const flat_unordered_set &other)
 拷贝赋值运算符
 flat_unordered_set (flat_unordered_set &&other) noexcept(is_nothrow_move_constructible_v< base_type >)
 移动构造函数
flat_unordered_setoperator= (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, iteratorequal_range (const key_type &key)
 获取等于指定键的元素范围
pair< const_iterator, const_iteratorequal_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_))
 小于比较操作符
Public 成员函数 继承自 neforce::icollector< T >
constexpr decltype(auto) size () const noexcept(noexcept(derived().size()))
 获取集合大小
constexpr bool empty () const noexcept(noexcept(derived().empty()))
 检查集合是否为空
Public 成员函数 继承自 neforce::icomparable< T >
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 >

平坦无序集合容器

模板参数
Value值类型
HashFcn哈希函数类型,默认为 hash<Value>
EqualKey键相等比较函数类型,默认为 equal_to<Value>
Alloc分配器类型

flat_unordered_set 是一种关联容器,存储唯一的键值,每个键在容器中唯一。 元素无序存储,由哈希函数将键映射到槽位。 底层使用开放寻址平坦哈希表,提供优于链地址法的缓存局部性。

在文件 flat_unordered_set.hpp37 行定义.

构造及析构函数说明

◆ flat_unordered_set() [1/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( )
default

◆ flat_unordered_set() [2/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( const size_type n)
inlineexplicit

构造函数,指定初始容量

参数
n初始容量提示

在文件 flat_unordered_set.hpp76 行定义.

◆ flat_unordered_set() [3/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( const size_type n,
const hasher & hf )
inline

构造函数,指定初始容量和哈希函数

参数
n初始容量提示
hf哈希函数

在文件 flat_unordered_set.hpp84 行定义.

◆ flat_unordered_set() [4/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( const size_type n,
const hasher & hf,
const key_equal & eql )
inline

构造函数,指定初始容量、哈希函数和键相等比较函数

参数
n初始容量提示
hf哈希函数
eql键相等比较函数

在文件 flat_unordered_set.hpp93 行定义.

◆ flat_unordered_set() [5/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( const flat_unordered_set< Value, HashFcn, EqualKey, Alloc > & other)
inline

拷贝构造函数

参数
otherflat_unordered_set

在文件 flat_unordered_set.hpp100 行定义.

引用了 flat_unordered_set().

◆ flat_unordered_set() [6/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( flat_unordered_set< Value, HashFcn, EqualKey, Alloc > && other)
inlinenoexcept

移动构造函数

参数
otherflat_unordered_set

在文件 flat_unordered_set.hpp117 行定义.

引用了 flat_unordered_set(), neforce::is_nothrow_move_constructible_v , 以及 neforce::move().

◆ flat_unordered_set() [7/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
template<typename Iterator>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( Iterator first,
Iterator last )
inline

范围构造函数

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

在文件 flat_unordered_set.hpp137 行定义.

◆ flat_unordered_set() [8/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
template<typename Iterator>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( Iterator first,
Iterator last,
const size_type n )
inline

范围构造函数,指定初始容量

模板参数
Iterator迭代器类型
参数
first起始迭代器
last结束迭代器
n初始容量提示

在文件 flat_unordered_set.hpp150 行定义.

◆ flat_unordered_set() [9/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
template<typename Iterator>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( Iterator first,
Iterator last,
const size_type n,
const hasher & hf )
inline

范围构造函数,指定初始容量和哈希函数

模板参数
Iterator迭代器类型
参数
first起始迭代器
last结束迭代器
n初始容量提示
hf哈希函数

在文件 flat_unordered_set.hpp164 行定义.

◆ flat_unordered_set() [10/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
template<typename Iterator>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( Iterator first,
Iterator last,
const size_type n,
const hasher & hf,
const key_equal & eql )
inline

范围构造函数,指定初始容量、哈希函数和键相等比较函数

模板参数
Iterator迭代器类型
参数
first起始迭代器
last结束迭代器
n初始容量提示
hf哈希函数
eql键相等比较函数

在文件 flat_unordered_set.hpp179 行定义.

◆ flat_unordered_set() [11/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( std::initializer_list< value_type > ilist)
inline

初始化列表构造函数

参数
ilist初始化列表

在文件 flat_unordered_set.hpp188 行定义.

引用了 begin(), end() , 以及 flat_unordered_set().

◆ flat_unordered_set() [12/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( std::initializer_list< value_type > ilist,
const size_type n )
inline

初始化列表构造函数,指定初始容量

参数
ilist初始化列表
n初始容量提示

在文件 flat_unordered_set.hpp196 行定义.

引用了 begin(), end() , 以及 flat_unordered_set().

◆ flat_unordered_set() [13/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( std::initializer_list< value_type > ilist,
const size_type n,
const hasher & hf )
inline

初始化列表构造函数,指定初始容量和哈希函数

参数
ilist初始化列表
n初始容量提示
hf哈希函数

在文件 flat_unordered_set.hpp205 行定义.

引用了 begin(), end() , 以及 flat_unordered_set().

◆ flat_unordered_set() [14/14]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::flat_unordered_set ( std::initializer_list< value_type > ilist,
const size_type n,
const hasher & hf,
const key_equal & eql )
inline

初始化列表构造函数,指定初始容量、哈希函数和键相等比较函数

参数
ilist初始化列表
n初始容量提示
hf哈希函数
eql键相等比较函数

在文件 flat_unordered_set.hpp215 行定义.

引用了 begin(), end() , 以及 flat_unordered_set().

成员函数说明

◆ begin() [1/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
const_iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::begin ( ) const
inlinenodiscardnoexcept

获取常量起始迭代器

返回
指向第一个元素的常量迭代器

在文件 flat_unordered_set.hpp235 行定义.

◆ begin() [2/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::begin ( )
inlinenodiscardnoexcept

获取起始迭代器

返回
指向第一个元素的迭代器

在文件 flat_unordered_set.hpp223 行定义.

被这些函数引用 flat_unordered_set(), flat_unordered_set(), flat_unordered_set() , 以及 flat_unordered_set().

◆ capacity()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
size_type neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::capacity ( ) const
inlinenodiscardnoexcept

获取容量

返回
slot 总数

在文件 flat_unordered_set.hpp277 行定义.

◆ cbegin()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
const_iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::cbegin ( ) const
inlinenodiscardnoexcept

获取常量起始迭代器

返回
指向第一个元素的常量迭代器

在文件 flat_unordered_set.hpp247 行定义.

◆ cend()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
const_iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::cend ( ) const
inlinenodiscardnoexcept

获取常量结束迭代器

返回
指向末尾的常量迭代器

在文件 flat_unordered_set.hpp253 行定义.

◆ contains()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
bool neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::contains ( const key_type & key) const
inlinenodiscardnoexcept

检查是否包含指定键

参数
key要检查的键
返回
是否包含

在文件 flat_unordered_set.hpp293 行定义.

◆ count()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
size_type neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::count ( const key_type & key) const
inlinenodiscardnoexcept

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

参数
key要统计的键
返回
匹配的元素数量(0 或 1)

在文件 flat_unordered_set.hpp284 行定义.

◆ emplace()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
template<typename... Args>
pair< iterator, bool > neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::emplace ( Args &&... args)
inline

在容器中就地构造元素

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

在文件 flat_unordered_set.hpp350 行定义.

引用了 neforce::forward().

◆ empty()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
bool neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::empty ( ) const
inlinenodiscardnoexcept

检查是否为空

返回
是否为空

在文件 flat_unordered_set.hpp271 行定义.

◆ end() [1/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
const_iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::end ( ) const
inlinenodiscardnoexcept

获取常量结束迭代器

返回
指向末尾的常量迭代器

在文件 flat_unordered_set.hpp241 行定义.

◆ end() [2/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::end ( )
inlinenodiscardnoexcept

获取结束迭代器

返回
指向末尾的迭代器

在文件 flat_unordered_set.hpp229 行定义.

被这些函数引用 flat_unordered_set(), flat_unordered_set(), flat_unordered_set() , 以及 flat_unordered_set().

◆ equal_range() [1/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
pair< iterator, iterator > neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::equal_range ( const key_type & key)
inlinenodiscard

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

参数
key键值
返回
包含范围起始和结束的 pair

在文件 flat_unordered_set.hpp448 行定义.

◆ equal_range() [2/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
pair< const_iterator, const_iterator > neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::equal_range ( const key_type & key) const
inlinenodiscard

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

参数
key键值
返回
包含范围起始和结束的 pair

在文件 flat_unordered_set.hpp455 行定义.

◆ equal_to()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
bool neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::equal_to ( const flat_unordered_set< Value, HashFcn, EqualKey, Alloc > & rhs) const
inlinenodiscardnoexcept

相等比较操作符

参数
rhs右侧容器
返回
是否相等

在文件 flat_unordered_set.hpp470 行定义.

引用了 flat_unordered_set().

◆ erase() [1/5]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
const_iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::erase ( const const_iterator first,
const const_iterator last )
inlinenoexcept

删除指定范围内的常量元素

参数
first起始迭代器
last结束迭代器
返回
指向最后一个被删除元素之后位置的常量迭代器

在文件 flat_unordered_set.hpp420 行定义.

◆ erase() [2/5]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
const_iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::erase ( const const_iterator position)
inlinenoexcept

删除指定位置的常量元素

参数
position要删除的位置
返回
指向被删除元素之后位置的常量迭代器

在文件 flat_unordered_set.hpp412 行定义.

◆ erase() [3/5]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::erase ( const iterator first,
const iterator last )
inlinenoexcept

删除指定范围内的元素

参数
first起始迭代器
last结束迭代器
返回
指向最后一个被删除元素之后位置的迭代器

在文件 flat_unordered_set.hpp405 行定义.

◆ erase() [4/5]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::erase ( const iterator position)
inlinenoexcept

删除指定位置的元素

参数
position要删除的位置
返回
指向被删除元素之后位置的迭代器

在文件 flat_unordered_set.hpp397 行定义.

◆ erase() [5/5]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
size_type neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::erase ( const key_type & key)
inlinenoexcept

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

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

在文件 flat_unordered_set.hpp390 行定义.

◆ find() [1/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::find ( const key_type & key)
inlinenodiscard

查找具有指定键的元素

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

在文件 flat_unordered_set.hpp434 行定义.

◆ find() [2/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
const_iterator neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::find ( const key_type & key) const
inlinenodiscard

查找具有指定键的常量元素

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

在文件 flat_unordered_set.hpp441 行定义.

◆ hash_function()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
hasher neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::hash_function ( ) const
inlinenodiscardnoexcept

获取哈希函数对象

返回
哈希函数对象的副本

在文件 flat_unordered_set.hpp301 行定义.

引用了 hash_function().

被这些函数引用 hash_function().

◆ insert() [1/4]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
pair< iterator, bool > neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::insert ( const value_type & value)
inline

插入元素(拷贝版本)

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

在文件 flat_unordered_set.hpp359 行定义.

◆ insert() [2/4]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
template<typename Iterator>
void neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::insert ( Iterator first,
Iterator last )
inline

范围插入元素

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

在文件 flat_unordered_set.hpp375 行定义.

◆ insert() [3/4]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
void neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::insert ( std::initializer_list< value_type > ilist)
inline

初始化列表插入元素

参数
ilist初始化列表

在文件 flat_unordered_set.hpp383 行定义.

◆ insert() [4/4]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
pair< iterator, bool > neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::insert ( value_type && value)
inline

移动插入元素

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

在文件 flat_unordered_set.hpp366 行定义.

引用了 neforce::move().

◆ key_eql()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
key_equal neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::key_eql ( ) const
inlinenodiscardnoexcept

获取键相等比较函数对象

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

在文件 flat_unordered_set.hpp309 行定义.

引用了 key_eql().

被这些函数引用 key_eql().

◆ less_than()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
bool neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::less_than ( const flat_unordered_set< Value, HashFcn, EqualKey, Alloc > & rhs) const
inlinenodiscardnoexcept

小于比较操作符

参数
rhs右侧容器
返回
按字典序比较结果

在文件 flat_unordered_set.hpp479 行定义.

引用了 flat_unordered_set().

◆ load_factor()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
float neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::load_factor ( ) const
inlinenodiscardnoexcept

获取当前负载因子

返回
负载因子

在文件 flat_unordered_set.hpp315 行定义.

◆ max_load_factor() [1/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
float neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::max_load_factor ( ) const
inlinenodiscardnoexcept

获取最大负载因子

返回
最大负载因子

在文件 flat_unordered_set.hpp321 行定义.

◆ max_load_factor() [2/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
void neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::max_load_factor ( const float lf)
inlinenoexcept

设置最大负载因子

参数
lf新的最大负载因子

在文件 flat_unordered_set.hpp327 行定义.

◆ max_size()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
size_type neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::max_size ( ) const
inlinenodiscardnoexcept

获取最大可能大小

返回
最大元素数量

在文件 flat_unordered_set.hpp265 行定义.

◆ operator=() [1/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
flat_unordered_set & neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::operator= ( const flat_unordered_set< Value, HashFcn, EqualKey, Alloc > & other)
inline

拷贝赋值运算符

参数
otherflat_unordered_set
返回
自身引用

在文件 flat_unordered_set.hpp108 行定义.

引用了 flat_unordered_set().

◆ operator=() [2/2]

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
flat_unordered_set & neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::operator= ( flat_unordered_set< Value, HashFcn, EqualKey, Alloc > && other)
inlinenoexcept

移动赋值运算符

参数
otherflat_unordered_set
返回
自身引用

在文件 flat_unordered_set.hpp125 行定义.

引用了 flat_unordered_set(), neforce::is_nothrow_move_assignable_v , 以及 neforce::move().

◆ rehash()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
void neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::rehash ( const size_type n)
inline

重新哈希,调整容量

参数
n目标容量

在文件 flat_unordered_set.hpp333 行定义.

◆ reserve()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
void neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::reserve ( const size_type n)
inline

预留空间

参数
n期望的元素数量

确保容器至少能容纳 n 个元素而不触发 rehash。

在文件 flat_unordered_set.hpp341 行定义.

◆ size()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
size_type neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::size ( ) const
inlinenodiscardnoexcept

获取元素数量

返回
元素数量

在文件 flat_unordered_set.hpp259 行定义.

◆ swap()

template<typename Value, typename HashFcn = hash<Value>, typename EqualKey = equal_to<Value>, typename Alloc = allocator<Value>>
void neforce::flat_unordered_set< Value, HashFcn, EqualKey, Alloc >::swap ( flat_unordered_set< Value, HashFcn, EqualKey, Alloc > & other)
inlinenoexcept

交换两个容器

参数
other要交换的容器

在文件 flat_unordered_set.hpp463 行定义.

引用了 flat_unordered_set() , 以及 neforce::is_nothrow_swappable_v.


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