std::unordered_set
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <unordered_set>
|
||
| template< class Key, |
(C++11 起) | |
无序集是一个关联容器,包含设定的Key类型的唯一对象。搜索,插入和去除的平均常数时间复杂.
Original:
Unordered set is an associative container that contains set of unique objects of type Key. Search, insertion, and removal have average constant-time complexity.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
std::unordered_set符合要求的Container,AllocatorAwareContainer,UnorderedAssociativeContainer.Original:
std::unordered_set meets the requirements of Container, AllocatorAwareContainer, UnorderedAssociativeContainer.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 会员类型
| 会员类型
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
key_type
|
Key
|
value_type
|
Key
|
size_type
|
无符号整数类型(通常是size_t)
Original: Unsigned integral type (usually size_t) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
difference_type
|
Signed integer type (usually 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
|
一个迭代器类型的类别,价值的差异,指针and
引用类型是一样 iterator。这iterator可以用来遍历一个单斗,但不能跨越桶 Original: 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 The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
const_local_iterator
|
一个迭代器类型的类别,价值的差异,指针and
引用类型是一样 const_iterator。这iterator可以用来遍历一个单斗,但不能跨越桶 Original: 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 The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[编辑] 成员函数
| 构建 unordered_set Original: constructs the unordered_set The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
destructs the unordered_set (公共成员函数) | |
| 将值分配到容器中 Original: assigns values to the container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 返回的关联分配器 Original: returns the associated allocator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
Original: Iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 返回一个迭代的开始 Original: returns an iterator to the beginning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 返回一个迭代的结束 Original: returns an iterator to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
Original: Capacity The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 检查是否容器是空的 Original: checks whether the container is empty The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 返回的元素数 Original: returns the number of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 返回可能的最大数量的元素 Original: returns the maximum possible number of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
Original: Modifiers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 清除其内容 Original: clears the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 插入元素 Original: inserts elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| constructs element in-place (公共成员函数) | |
| 构建了一丝元素的地方使用 Original: constructs elements in-place using a hint The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 擦除元素 Original: erases elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 交换的内容 Original: swaps the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
Original: Lookup The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 返回匹配的特定键的元素的数量 Original: returns the number of elements matching specific key The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 发现与特定键的元素 Original: finds element with specific key The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 回报在一个特定的键匹配的元素 Original: returns range of elements matching a specific key The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
Original: Bucket interface The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 返回一个迭代器指定的桶开始 Original: returns an iterator to the beginning of the specified bucket The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 返回一个迭代器指定的桶 Original: returns an iterator to the end of the specified bucket The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 返回桶的数量 Original: returns the number of buckets The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| returns the maximum number of buckets (公共成员函数) | |
| 返回在特定的桶的元素的数量 Original: returns the number of elements in specific bucket The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 返回特定的键的桶 Original: returns the bucket for specific key The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
Original: Hash policy The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 返回平均每个桶的元素 Original: returns average number of elements per bucket The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 管理最大平均每个桶的元素 Original: manages maximum average number of elements per bucket The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| reserves at least the specified number of buckets. This regenerates the hash table. (公共成员函数) | |
| 保留空间至少指定数量的elements. This重新生成哈希表. Original: reserves space for at least the specified number of elements. This regenerates the hash table. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
Original: Observers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 使用散列键返回功能 Original: returns function used to hash the keys The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 返回功能键平等 Original: returns the function used to compare keys for equality The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
[编辑] 非成员函数
| 比较在unordered_set值 Original: compares the values in the unordered_set The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) | |
| 专业的std::swap算法 Original: specializes the std::swap algorithm The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) | |