STL-unordered_multiset

简介

unordered_multiset 与 unordered_set 类似,为C++11引入的无序(哈希)容器

unordered_multiset 容器和 unordered_set 容器唯一的差别在于,unordered_multiset 容器允许存储多个值相同的元素,而 unordered_set 容器中只能存储互不相同的元素,且其底层为哈希表,unordered_multiset 所有元素为 const 特性,即不允许修改,但可以插入和删除

unordered_multiset为关联式容器,底层为哈希表(Hash-Table)

类模板

1
2
3
4
5
6
template<
class Key,
class Hash = std::hash<Key>,
class KeyEqual = std::equal_to<Key>,
class Allocator = std::allocator<Key>
> class unordered_multiset;

其成员函数,迭代器等与 unordered_set 无异