std::unordered_multimap
来自cppreference.com
![]() |
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <unordered_map> 中定义
|
||
template< class Key, |
(C++11 起) | |
无序多重映射是一个无序关联容器,支持多个相等的键(unordered_multimap中,每个键对应的值可能不唯一)以及相关联的另一种类型的值。 unordered_multimap类支持前向迭代器。搜索,插入和去除具有平摊的常数时间复杂度。
原文:
Unordered multimap is an unordered associative container that supports equivalent keys (an unordered_multimap may contain multiple copies of each key value) and that associates values of another type with the keys. The unordered_multimap class supports forward iterators. Search, insertion, and removal have average constant-time complexity.
std::unordered_multimap
符合Container
,AllocatorAwareContainer
,UnorderedAssociativeContainer
的要求。原文:
std::unordered_multimap
meets the requirements of Container
, AllocatorAwareContainer
, UnorderedAssociativeContainer
.[编辑] 成员类型
成员类型
|
定义 |
key_type
|
Key
|
mapped_type
|
T
|
value_type
|
std::pair<const Key, T> |
size_type
|
无符号整型(通常是size_t)
原文: Unsigned integral type (usually size_t) |
difference_type
|
有符号整型 (通常是ptrdiff_t) |
hasher
|
Hash
|
key_equal
|
KeyEqual
|
allocator_type
|
Allocator
|
reference
|
value_type&
|
const_reference
|
const value_type&
|
pointer
|
std::allocator_traits<Allocator>::pointer |
const_pointer
|
std::allocator_traits<Allocator>::const_pointer |
iterator
|
ForwardIterator
|
const_iterator
|
前向常迭代器 |
local_iterator
|
一个迭代器类型,它的分类,值,差异,指针和
引用类型都和 iterator 一样。这个迭代器可以用于遍历单个桶,但不能跨越不同的桶。 原文: An iterator type whose category, value, difference, pointer and reference types are the same as iterator . This iteratorcan be used to iterate through a single bucket but not across buckets |
const_local_iterator
|
一个迭代器类型,它的分类,值,差异,指针和
引用类型都和 const_iterator 一样。这个迭代器可以用于遍历单个桶,但不能跨越不同的桶。 原文: An iterator type whose category, value, difference, pointer and reference types are the same as const_iterator . This iteratorcan be used to iterate through a single bucket but not across buckets |
[编辑] 成员函数
构造 unordered_multimap (公共成员函数) | |
析构 unordered_multimap (公共成员函数) | |
将值赋给容器 (公共成员函数) | |
返回相关的分配器 (公共成员函数) | |
| |
返回指向容器第一个元素的迭代器 (公共成员函数) | |
返回指向容器尾端的迭代器 (公共成员函数) | |
| |
检查容器是否为空 原文: checks whether the container is empty (公共成员函数) | |
返回容纳的元素数 (公共成员函数) | |
返回可容纳的最大元素数 (公共成员函数) | |
| |
删除全部内容 (公共成员函数) | |
插入元素 (公共成员函数) | |
就地构造元素 (公共成员函数) | |
使用hint就地构造元素 原文: constructs elements in-place using a (公共成员函数) | |
删除元素 (公共成员函数) | |
交换unordered_multimap 的内容 (公共成员函数) | |
| |
返回匹配特定键的元素数量 原文: returns the number of elements matching specific key (公共成员函数) | |
寻找带有特定键的元素 (公共成员函数) | |
返回匹配特定键的元素范围 原文: returns range of elements matching a specific key (公共成员函数) | |
| |
返回一个迭代器,指向指定的桶的开始 原文: returns an iterator to the beginning of the specified bucket (公共成员函数) | |
返回一个迭代器,指向指定的桶的末尾 原文: returns an iterator to the end of the specified bucket (公共成员函数) | |
返回桶的数量 (公共成员函数) | |
返回桶的最大数量 原文: returns the maximum number of buckets (公共成员函数) | |
返回在特定的桶中的元素数量 原文: returns the number of elements in specific bucket (公共成员函数) | |
返回带有特定键的桶 (公共成员函数) | |
| |
返回每个桶的平均元素数量 原文: returns average number of elements per bucket (公共成员函数) | |
管理每个桶的平均元素数量的最大值 原文: manages maximum average number of elements per bucket (公共成员函数) | |
为至少为指定数量的桶预留存储空间。 这会重新生成哈希表。 (公共成员函数) | |
为至少为指定数量的元素预留存储空间。 这会重新生成哈希表。 原文: reserves space for at least the specified number of elements. This regenerates the hash table. (公共成员函数) | |
| |
返回用于为键生成散列的函数 原文: returns function used to hash the keys (公共成员函数) | |
返回用于比较键的相等性的函数 原文: returns the function used to compare keys for equality (公共成员函数) |
[编辑] 非成员函数
比较unordered_multimap中的值 原文: compares the values in the unordered_multimap (函数模板) | |
特化的std::swap算法 (函数模板) |