std::unordered_multimap::unordered_multimap
STD:无序[医]Multimap::无序[医]穆蒂马普
| (1) | |
---|---|---|
explicit unordered_multimap( size_type bucket_count = /*implementation-defined*/, const Hash& hash = Hash(), const KeyEqual& equal = KeyEqual(), const Allocator& alloc = Allocator() | (since C++11) (until C++14) | |
unordered_multimap() : unordered_multimap( size_type(/*implementation-defined*/) ) {} explicit unordered_multimap( size_type bucket_count, const Hash& hash = Hash(), const KeyEqual& equal = KeyEqual(), const Allocator& alloc = Allocator() | (since C++14) | |
unordered_multimap( size_type bucket_count, const Allocator& alloc ) : unordered_multimap(bucket_count, Hash(), KeyEqual(), alloc) {} unordered_multimap( size_type bucket_count, const Hash& hash, const Allocator& alloc ) : unordered_multimap(bucket_count, hash, KeyEqual(), alloc) {} | (1) | (since C++14) |
explicit unordered_multimap( const Allocator& alloc | (1) | (since C++11) |
template< class InputIt > unordered_multimap( InputIt first, InputIt last, size_type bucket_count = /*implementation-defined*/, const Hash& hash = Hash(), const KeyEqual& equal = KeyEqual(), const Allocator& alloc = Allocator() | (2) | (since C++11) |
template< class InputIt > unordered_multimap( InputIt first, InputIt last, size_type bucket_count, const Allocator& alloc ) : unordered_multimap(first, last, bucket_count, Hash(), KeyEqual(), alloc) {} | (2) | (since C++14) |
template< class InputIt > unordered_multimap( InputIt first, InputIt last, size_type bucket_count, const Hash& hash, const Allocator& alloc ) : unordered_multimap(first, last, bucket_count, hash, KeyEqual(), alloc) {} | (2) | (since C++14) |
unordered_multimap( const unordered_multimap& other | (3) | (since C++11) |
unordered_multimap( const unordered_multimap& other, const Allocator& alloc | (3) | (since C++11) |
unordered_multimap( unordered_multimap&& other | (4) | (since C++11) |
unordered_multimap( unordered_multimap&& other, const Allocator& alloc | (4) | (since C++11) |
unordered_multimap( std::initializer_list<value_type> init, size_type bucket_count = /*implementation-defined*/, const Hash& hash = Hash(), const KeyEqual& equal = KeyEqual(), const Allocator& alloc = Allocator() | (5) | (since C++11) |
unordered_multimap( std::initializer_list<value_type> init, size_type bucket_count, const Allocator& alloc ) : unordered_multimap(init, bucket_count, Hash(), KeyEqual(), alloc) {} | (5) | (since C++14) |
unordered_multimap( std::initializer_list<value_type> init, size_type bucket_count, const Hash& hash, const Allocator& alloc ) : unordered_multimap(init, bucket_count, hash, KeyEqual(), alloc) {} | (5) | (since C++14) |
从各种数据源构造新容器。可选地使用所提供的用户bucket_count
作为要创建的最少数量的桶,hash
作为散列函数,equal
作为比较键和alloc
作为分配器。
1%29构造空容器。集max_load_factor()
到1.0。对于默认构造函数,桶的数量是实现定义的。
2%29构造包含范围内容的容器。[first, last)
.成套max_load_factor()
到1.0。
3%29复制构造函数。的内容的副本构造容器。other,复制加载因子、谓词和哈希函数。如果alloc不提供,则通过调用std::allocator_traits<allocator_type>::select_on_container_copy_construction(other.get_allocator())...
4%29移动构造函数。的内容构造容器。other
使用移动语义。如果alloc
如果不提供分配器,则通过移动构造从属于other
...
5%29使用初始化程序列表的内容构造容器。init
,和无序一样[医]多任务%28 init
.start%28%29,init
.end%28%29%29。
参数
alloc | - | allocator to use for all memory allocations of this container |
---|---|---|
bucket_count | - | minimal number of buckets to use on initialization. If it is not specified, implementation-defined default value is used |
hash | - | hash function to use |
equal | - | comparison function to use for all key comparisons of this container |
first, last | - | the range to copy the elements from |
other | - | another container to be used as source to initialize the elements of the container with |
init | - | initializer list to initialize the elements of the container with |
类型要求
-输入必须符合输入器的要求。
复杂性
1%29常数
2%29平均情况下线性最坏情况二次之间的距离first
和last
3%29线性other
4%29常数。如果alloc
被赋予和alloc != other.get_allocator()
,然后是线性的。
5%29平均线性最坏情况二次型init
注记
在容器移动构造%28重载%284%29%29之后,引用、指针和迭代器%28---other
保持有效,但引用当前在*this
.现行标准通过第23.2.1节中的总括声明作出这一保证。集装箱。所需经费/12,目前正在考虑通过以下方式提供更直接的担保:lwg 2321...
例
另见
operator= | assigns values to the container (public member function) |
---|
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
http://en.cppreference.com/w/cpp/container/unorder[医]多重/无序[医]穆蒂马普