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

无序多重映射容器 更多...

#include <unordered_multimap.hpp>

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::pointer
 指针类型
using const_pointer = typename base_type::const_pointer
 常量指针类型
using reference = typename base_type::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 成员函数

 unordered_multimap ()=default
 默认构造函数
 unordered_multimap (size_type n)
 构造函数,指定初始桶数
 unordered_multimap (size_type n, const hasher &hf)
 构造函数,指定初始桶数和哈希函数
 unordered_multimap (size_type n, const hasher &hf, const key_equal &eql)
 构造函数,指定初始桶数、哈希函数和键相等比较函数
 unordered_multimap (const unordered_multimap &other)
 拷贝构造函数
unordered_multimapoperator= (const unordered_multimap &other)
 拷贝赋值运算符
 unordered_multimap (unordered_multimap &&other) noexcept(is_nothrow_move_constructible_v< base_type >)
 移动构造函数
unordered_multimapoperator= (unordered_multimap &&other) noexcept(is_nothrow_move_assignable_v< base_type >)
 移动赋值运算符
template<typename Iterator>
 unordered_multimap (Iterator first, Iterator last)
 范围构造函数
template<typename Iterator>
 unordered_multimap (Iterator first, Iterator list, size_type n)
 范围构造函数,指定初始桶数
template<typename Iterator>
 unordered_multimap (Iterator first, Iterator last, size_type n, const hasher &hf)
 范围构造函数,指定初始桶数和哈希函数
template<typename Iterator>
 unordered_multimap (Iterator first, Iterator last, size_type n, const hasher &hf, const key_equal &eql)
 范围构造函数,指定初始桶数、哈希函数和键相等比较函数
 unordered_multimap (std::initializer_list< value_type > ilist)
 初始化列表构造函数
 unordered_multimap (std::initializer_list< value_type > ilist, size_type n)
 初始化列表构造函数,指定初始桶数
 unordered_multimap (std::initializer_list< value_type > ilist, size_type n, const hasher &hf)
 初始化列表构造函数,指定初始桶数和哈希函数
 unordered_multimap (std::initializer_list< value_type > ilist, size_type n, const hasher &hf, const key_equal &eql)
 初始化列表构造函数,指定初始桶数、哈希函数和键相等比较函数
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 size_type size () const noexcept
 获取元素数量
NEFORCE_NODISCARD size_type max_size () const noexcept
 获取最大可能大小
NEFORCE_NODISCARD bool empty () const noexcept
 检查是否为空
NEFORCE_NODISCARD size_type count (const key_type &key) const noexcept(noexcept(ht_.count(key)))
 统计具有指定键的元素数量
NEFORCE_NODISCARD size_type buckets_size () const noexcept
 获取桶数量
NEFORCE_NODISCARD size_type buckets_max_count () const noexcept
 获取最大桶数量
NEFORCE_NODISCARD size_type bucket_size (size_type n) const noexcept
 获取指定桶的大小
NEFORCE_NODISCARD hasher hash_func () const noexcept(noexcept(ht_.hash_func()))
 获取哈希函数对象
NEFORCE_NODISCARD key_equal key_eql () const noexcept(noexcept(ht_.key_eql()))
 获取键相等比较函数对象
NEFORCE_NODISCARD float load_factor () const noexcept
 获取当前负载因子
NEFORCE_NODISCARD float max_load_factor () const noexcept
 获取最大负载因子
void max_load_factor (float lf) noexcept
 设置最大负载因子
void rehash (size_type n)
 重新哈希,调整桶数量
void reserve (size_type n)
 预留空间
template<typename... Args>
iterator emplace (Args &&... args)
 在unordered_multimap中就地构造元素
iterator insert (const value_type &value)
 拷贝插入元素
iterator insert (value_type &&value)
 移动插入元素
template<typename Iterator>
void insert (Iterator first, Iterator last)
 范围插入元素
size_type erase (const key_type &key) noexcept
 删除所有具有指定键的元素
iterator erase (iterator position) noexcept
 删除指定位置的元素
iterator erase (iterator first, iterator last) noexcept
 删除指定范围内的元素
const_iterator erase (const_iterator position) noexcept
 删除指定位置的常量元素
const_iterator erase (const_iterator first, const_iterator last) noexcept
 删除指定范围内的常量元素
void clear () noexcept
 清空unordered_multimap
NEFORCE_NODISCARD iterator find (const key_type &key)
 查找具有指定键的元素
NEFORCE_NODISCARD const_iterator find (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 (unordered_multimap &other) noexcept(is_nothrow_swappable_v< base_type >)
 交换两个unordered_multimap的内容
NEFORCE_NODISCARD bool operator== (const unordered_multimap &rhs) const noexcept(noexcept(ht_==rhs.ht_))
 相等比较操作符
NEFORCE_NODISCARD bool operator< (const unordered_multimap &rhs) const noexcept(noexcept(ht_< rhs.ht_))
 小于比较操作符

详细描述

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
class unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >

无序多重映射容器

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

unordered_multimap是一种关联容器,存储键值对(key-value pairs),允许重复键。 元素无序存储,由哈希函数将键映射到桶中。 支持快速的键查找,且允许重复键。底层使用哈希表实现。

在文件 unordered_multimap.hpp38 行定义.

构造及析构函数说明

◆ unordered_multimap() [1/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( )
default

◆ unordered_multimap() [2/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( size_type n)
inlineexplicit

构造函数,指定初始桶数

参数
n初始桶数

在文件 unordered_multimap.hpp80 行定义.

◆ unordered_multimap() [3/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( size_type n,
const hasher & hf )
inline

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

参数
n初始桶数
hf哈希函数

在文件 unordered_multimap.hpp88 行定义.

◆ unordered_multimap() [4/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( size_type n,
const hasher & hf,
const key_equal & eql )
inline

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

参数
n初始桶数
hf哈希函数
eql键相等比较函数

在文件 unordered_multimap.hpp97 行定义.

◆ unordered_multimap() [5/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( const unordered_multimap< Key, T, HashFcn, EqualKey, Alloc > & other)
inline

拷贝构造函数

参数
other源unordered_multimap

在文件 unordered_multimap.hpp104 行定义.

引用了 unordered_multimap().

◆ unordered_multimap() [6/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( unordered_multimap< Key, T, HashFcn, EqualKey, Alloc > && other)
inlinenoexcept

移动构造函数

参数
other源unordered_multimap

在文件 unordered_multimap.hpp121 行定义.

引用了 is_nothrow_move_constructible_v, move() , 以及 unordered_multimap().

◆ unordered_multimap() [7/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
template<typename Iterator>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( Iterator first,
Iterator last )
inline

范围构造函数

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

在文件 unordered_multimap.hpp141 行定义.

◆ unordered_multimap() [8/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
template<typename Iterator>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( Iterator first,
Iterator list,
size_type n )
inline

范围构造函数,指定初始桶数

模板参数
Iterator迭代器类型
参数
first起始迭代器
list结束迭代器
n初始桶数

在文件 unordered_multimap.hpp154 行定义.

◆ unordered_multimap() [9/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
template<typename Iterator>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( Iterator first,
Iterator last,
size_type n,
const hasher & hf )
inline

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

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

在文件 unordered_multimap.hpp168 行定义.

◆ unordered_multimap() [10/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
template<typename Iterator>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( Iterator first,
Iterator last,
size_type n,
const hasher & hf,
const key_equal & eql )
inline

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

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

在文件 unordered_multimap.hpp183 行定义.

◆ unordered_multimap() [11/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( std::initializer_list< value_type > ilist)
inline

初始化列表构造函数

参数
ilist初始化列表

在文件 unordered_multimap.hpp192 行定义.

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

◆ unordered_multimap() [12/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( std::initializer_list< value_type > ilist,
size_type n )
inline

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

参数
ilist初始化列表
n初始桶数

在文件 unordered_multimap.hpp200 行定义.

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

◆ unordered_multimap() [13/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( std::initializer_list< value_type > ilist,
size_type n,
const hasher & hf )
inline

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

参数
ilist初始化列表
n初始桶数
hf哈希函数

在文件 unordered_multimap.hpp209 行定义.

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

◆ unordered_multimap() [14/14]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::unordered_multimap ( std::initializer_list< value_type > ilist,
size_type n,
const hasher & hf,
const key_equal & eql )
inline

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

参数
ilist初始化列表
n初始桶数
hf哈希函数
eql键相等比较函数

在文件 unordered_multimap.hpp219 行定义.

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

成员函数说明

◆ begin() [1/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD const_iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::begin ( ) const
inlinenoexcept

获取常量起始迭代器

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

在文件 unordered_multimap.hpp238 行定义.

◆ begin() [2/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::begin ( )
inlinenoexcept

获取起始迭代器

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

在文件 unordered_multimap.hpp226 行定义.

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

◆ bucket_size()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD size_type unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::bucket_size ( size_type n) const
inlinenoexcept

获取指定桶的大小

参数
n桶索引
返回
桶中的元素数量

在文件 unordered_multimap.hpp302 行定义.

◆ buckets_max_count()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD size_type unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::buckets_max_count ( ) const
inlinenoexcept

获取最大桶数量

返回
最大桶数量

在文件 unordered_multimap.hpp295 行定义.

◆ buckets_size()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD size_type unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::buckets_size ( ) const
inlinenoexcept

获取桶数量

返回
桶数量

在文件 unordered_multimap.hpp289 行定义.

◆ cbegin()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD const_iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::cbegin ( ) const
inlinenoexcept

获取常量起始迭代器

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

在文件 unordered_multimap.hpp250 行定义.

◆ cend()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD const_iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::cend ( ) const
inlinenoexcept

获取常量结束迭代器

返回
指向最后一个元素之后位置的常量迭代器

在文件 unordered_multimap.hpp256 行定义.

◆ count()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD size_type unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::count ( const key_type & key) const
inlinenoexcept

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

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

在文件 unordered_multimap.hpp281 行定义.

◆ emplace()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
template<typename... Args>
iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::emplace ( Args &&... args)
inline

在unordered_multimap中就地构造元素

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

在文件 unordered_multimap.hpp355 行定义.

引用了 forward().

◆ empty()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD bool unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::empty ( ) const
inlinenoexcept

检查是否为空

返回
是否为空

在文件 unordered_multimap.hpp274 行定义.

◆ end() [1/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD const_iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::end ( ) const
inlinenoexcept

获取常量结束迭代器

返回
指向最后一个元素之后位置的常量迭代器

在文件 unordered_multimap.hpp244 行定义.

◆ end() [2/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::end ( )
inlinenoexcept

获取结束迭代器

返回
指向最后一个元素之后位置的迭代器

在文件 unordered_multimap.hpp232 行定义.

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

◆ equal_range() [1/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD pair< iterator, iterator > unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::equal_range ( const key_type & key)
inline

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

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

在文件 unordered_multimap.hpp445 行定义.

◆ equal_range() [2/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD pair< const_iterator, const_iterator > unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::equal_range ( const key_type & key) const
inline

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

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

在文件 unordered_multimap.hpp452 行定义.

◆ erase() [1/5]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
size_type unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::erase ( const key_type & key)
inlinenoexcept

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

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

在文件 unordered_multimap.hpp389 行定义.

◆ erase() [2/5]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
const_iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::erase ( const_iterator first,
const_iterator last )
inlinenoexcept

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

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

在文件 unordered_multimap.hpp419 行定义.

◆ erase() [3/5]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
const_iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::erase ( const_iterator position)
inlinenoexcept

删除指定位置的常量元素

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

在文件 unordered_multimap.hpp411 行定义.

◆ erase() [4/5]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::erase ( iterator first,
iterator last )
inlinenoexcept

删除指定范围内的元素

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

在文件 unordered_multimap.hpp404 行定义.

◆ erase() [5/5]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::erase ( iterator position)
inlinenoexcept

删除指定位置的元素

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

在文件 unordered_multimap.hpp396 行定义.

◆ find() [1/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::find ( const key_type & key)
inline

查找具有指定键的元素

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

在文件 unordered_multimap.hpp431 行定义.

◆ find() [2/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD const_iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::find ( const key_type & key) const
inline

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

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

在文件 unordered_multimap.hpp438 行定义.

◆ hash_func()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD hasher unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::hash_func ( ) const
inlinenoexcept

获取哈希函数对象

返回
哈希函数对象的副本

在文件 unordered_multimap.hpp308 行定义.

引用了 hash_func().

被这些函数引用 hash_func().

◆ insert() [1/3]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::insert ( const value_type & value)
inline

拷贝插入元素

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

在文件 unordered_multimap.hpp364 行定义.

◆ insert() [2/3]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
template<typename Iterator>
void unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::insert ( Iterator first,
Iterator last )
inline

范围插入元素

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

在文件 unordered_multimap.hpp380 行定义.

◆ insert() [3/3]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
iterator unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::insert ( value_type && value)
inline

移动插入元素

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

在文件 unordered_multimap.hpp371 行定义.

引用了 move().

◆ key_eql()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD key_equal unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::key_eql ( ) const
inlinenoexcept

获取键相等比较函数对象

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

在文件 unordered_multimap.hpp314 行定义.

引用了 key_eql().

被这些函数引用 key_eql().

◆ load_factor()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD float unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::load_factor ( ) const
inlinenoexcept

获取当前负载因子

返回
负载因子

在文件 unordered_multimap.hpp320 行定义.

◆ max_load_factor() [1/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD float unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::max_load_factor ( ) const
inlinenoexcept

获取最大负载因子

返回
最大负载因子

在文件 unordered_multimap.hpp326 行定义.

◆ max_load_factor() [2/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
void unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::max_load_factor ( float lf)
inlinenoexcept

设置最大负载因子

参数
lf新的最大负载因子

在文件 unordered_multimap.hpp332 行定义.

◆ max_size()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD size_type unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::max_size ( ) const
inlinenoexcept

获取最大可能大小

返回
最大元素数量

在文件 unordered_multimap.hpp268 行定义.

◆ operator<()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD bool unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::operator< ( const unordered_multimap< Key, T, HashFcn, EqualKey, Alloc > & rhs) const
inlinenoexcept

小于比较操作符

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

在文件 unordered_multimap.hpp476 行定义.

引用了 unordered_multimap().

◆ operator=() [1/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap & unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::operator= ( const unordered_multimap< Key, T, HashFcn, EqualKey, Alloc > & other)
inline

拷贝赋值运算符

参数
other源unordered_multimap
返回
自身引用

在文件 unordered_multimap.hpp112 行定义.

引用了 unordered_multimap().

◆ operator=() [2/2]

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
unordered_multimap & unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::operator= ( unordered_multimap< Key, T, HashFcn, EqualKey, Alloc > && other)
inlinenoexcept

移动赋值运算符

参数
other源unordered_multimap
返回
自身引用

在文件 unordered_multimap.hpp129 行定义.

引用了 is_nothrow_move_assignable_v, move() , 以及 unordered_multimap().

◆ operator==()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD bool unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::operator== ( const unordered_multimap< Key, T, HashFcn, EqualKey, Alloc > & rhs) const
inlinenoexcept

相等比较操作符

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

在文件 unordered_multimap.hpp467 行定义.

引用了 unordered_multimap().

◆ rehash()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
void unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::rehash ( size_type n)
inline

重新哈希,调整桶数量

参数
n目标桶数量

在文件 unordered_multimap.hpp338 行定义.

◆ reserve()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
void unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::reserve ( size_type n)
inline

预留空间

参数
n期望的元素数量

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

在文件 unordered_multimap.hpp346 行定义.

◆ size()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
NEFORCE_NODISCARD size_type unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::size ( ) const
inlinenoexcept

获取元素数量

返回
unordered_multimap中的元素数量

在文件 unordered_multimap.hpp262 行定义.

◆ swap()

template<typename Key, typename T, typename HashFcn = hash<Key>, typename EqualKey = equal_to<Key>, typename Alloc = allocator<hashtable_node<pair<const Key, T>>>>
void unordered_multimap< Key, T, HashFcn, EqualKey, Alloc >::swap ( unordered_multimap< Key, T, HashFcn, EqualKey, Alloc > & other)
inlinenoexcept

交换两个unordered_multimap的内容

参数
other要交换的另一个unordered_multimap

在文件 unordered_multimap.hpp460 行定义.

引用了 is_nothrow_swappable_v , 以及 unordered_multimap().


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