C++ std::unordered_multimap
std::unordered_multimap
template < class Key, // unordered_multimap::key_type
class T, // unordered_multimap::mapped_type
class Hash = hash<Key>, // unordered_multimap::hasher
class Pred = equal_to<Key>, // unordered_multimap::key_equal
class Alloc = allocator< pair<const Key,T> > // unordered_multimap::allocator_type
> class unordered_multimap;
Unordered Multimap
Unordered multimaps are associative containers that store elements formed by the combination of a key value and a mapped value, much like unordered_map containers, but allowing different elements to have equivalent keys.
In an unordered_multimap, the key value is generally used to uniquely identify the element, while the mapped value is an object with the content associated to this key. Types of key and mapped value may differ.
Internally, the elements in the unordered_multimap are not sorted in any particular order with respect to either their key or mapped values, but organized into buckets depending on their hash values to allow for fast access to individual elements directly by their key values (with a constant average time complexity on average).
Elements with equivalent keys are grouped together in the same bucket and in such a way that an iterator (see equal_range) can iterate through all of them.
Iterators in the container are at least forward iterators.
Notice that this container is not defined in its own header, but shares header <unordered_map> with unordered_map.
Reference
C++ std::unordered_multimap的更多相关文章
- 使用C++11的一点总结
C++11已不是新鲜技术,但对于我来说,工作中用得还不够多(前东家长时间使用gcc3.4.5,虽然去年升了4.8.2,但旧模块维护还是3.4.5居多:新东家用的是4.4.6,不能完整支持C ...
- STL set multiset map multimap unordered_set unordered_map example
I decide to write to my blogs in English. When I meet something hard to depict, I'll add some Chines ...
- c++11 : range-based for loop
0. 形式 for ( declaration : expression ) statement 0.1 根据标准将会扩展成这样的形式: 1 { 2 auto&& __ra ...
- [转载] C++11新特性
C++11标准发布已有一段时间了, 维基百科上有对C++11新标准的变化和C++11新特性介绍的文章. 我是一名C++程序员,非常想了解一下C++11. 英文版的维基百科看起来非常费劲,而中文版维基百 ...
- [技术] OIer的STL入门教程
注: 本文主要摘取STL在OI中的常用技巧应用, 所以可能会重点说明容器部分和算法部分, 且不会讨论所有支持的函数/操作并主要讨论 C++11 前支持的特性. 如果需要详细完整的介绍请自行查阅标准文档 ...
- 在C++98基础上学习C++11新特性
自己一直用的是C++98规范来编程,对于C++11只闻其名却没用过其特性.近期因为工作的需要,需要掌握C++11的一些特性,所以查阅了一些C++11资料.因为自己有C++98的基础,所以从C++98过 ...
- [技术] OIer的C++标准库 : STL入门
注: 本文主要摘取STL在OI中的常用技巧应用, 所以可能会重点说明容器部分和算法部分, 且不会讨论所有支持的函数/操作并主要讨论 C++11 前支持的特性. 如果需要详细完整的介绍请自行查阅标准文档 ...
- c++11——auto,decltype类型推导
c++11中引入了auto和decltype关键字实现类型推导,通过这两个关键字不仅能够方便的获取复杂的类型,而且还能简化书写,提高编码效率. auto和decltype的类型推导都是编译器在 ...
- stout代码分析之十一:hashmap和multihashmap
hashmap是std::unordered_map的子类,前者对后者的接口做了进一步封装. hashmap的移动构造函数: hashmap(std::map<Key, Value>&am ...
随机推荐
- 1.Django入门小Demo
1.Django安装 (1)前提:已安装python环境 (2)打开命令行输入:pip install Django==2.1.3 (3)打开Pycharm,在File--Setting--Proje ...
- 使用php生成数字、字母组合验证码(一)
项目中经常会遇到一些登陆验证,支付验证等等一系列安全验证的策略.实现方法多种多样,下面就来讲解下如何用php生成简单的文字+数字组合的验证码: 所用语言php,gd库 原理解释: a>实质上是在 ...
- debian修改连接数限制
golang写的socket做压力测试的时候,提示too many open files,解决方法如下 sudo gvim /etc/security/limits.conf 添加 * - nofil ...
- C#操作MySql数据库帮助类(Dapper,T-Sql)
using System.Text; using MySql.Data.MySqlClient; using System.Data; using Dapper; using System.Refle ...
- 设计模式——单例模式(C++)
一: 饿汉式单例: 静态区初始化instance,然后通过getInstance返回.这种方式没有多线程的问题,是一种以空间换时间的方式,不管程序用不用,都会构造唯一的实例. #pragma once ...
- *(ptr++) += 123
*(ptr++) += 123; 等价于:*(ptr) = *(ptr) + 123; ptr++; 而不是:*(ptr++) = *(ptr++) + 123;程序员面试宝典p32 #include ...
- Julia - 三元运算符
三元运算符的格式: a ? b : c a 是条件表达式,如果条件 a 为真,就执行 b:如果条件 a 为假,就执行 c 二选一 julia> println(1 < 2 ? " ...
- martin/docker-cleanup-volumes
https://hub.docker.com/r/martin/docker-cleanup-volumes/
- Spring实战之装配Bean
1.1Spring配置的可选方案 Spring容器负责创建应用程序中的bean并通过DI来协调这些对象之间的关系.但是,作为开发人员,你需要告诉Spring要创建哪些bean并且如何将其装配在一起.当 ...
- Django中多种重定向方法使用
本文主要讲解使用HttpResponseRedirect.redirect.reverse以及配置文件中配置URL等重定向方法 本文使用了Django1.8.2 使用场景,例如在表单一中提交数据后,需 ...