用unordered_map代替hash_map
来源:互联网 发布:南山空同 知乎 编辑:程序博客网 时间:2024/05/01 12:41
利用unordered_map代替hash_map
- 实验环境
- 操作系统 fedora9
- 编译器版本 gcc4.3
- 实验方式
各种map使用插入和查找,比较速度和相关性能
- 下面测试说明了速度之间的比较:
- 为什么要使用unordered_map代替hash_map?
- 因为标准化的推进,unordered_map原来属于boost分支和std::tr1中,而hash_map属于非标准容器。
- 另外,使用之后,感觉速度和hash_map差不多,但是支持string做key,也可以使用复杂的对象作为key。
- gxx需要添加编译选项:-std=gnu++0x或者-std=c++0x
- 在/usr/include/c++/4.3.0/backward/backward_warning.h文件中,明确写道:
This file includes at least one deprecated or antiquated header which \ may be removed without further notice at a future date. Please use a \ non-deprecated interface with equivalent functionality instead. For a \ listing of replacement headers and interfaces, consult the file \ backward_warning.h. To disable this warning use -Wno-deprecated.
/* A list of valid replacements is as follows:Use: Instead of:
<sstream>, basic_stringbuf <strstream>, strstreambuf
<sstream>, basic_istringstream <strstream>, istrstream
<sstream>, basic_ostringstream <strstream>, ostrstream
<sstream>, basic_stringstream <strstream>, strstream
<unordered_set>, unordered_set <ext/hash_set>, hash_set
<unordered_set>, unordered_multiset <ext/hash_set>, hash_multiset
<unordered_map>, unordered_map <ext/hash_set>, hash_map
<unordered_map>, unordered_multimap <ext/hash_set>, hash_multimap
<functional>, bind <functional>, binder1st
<functional>, bind <functional>, binder2nd
<functional>, bind <functional>, bind1st
<functional>, bind <functional>, bind2nd
<memory>, unique_ptr <memory>, auto_ptr
*/
0 0
- 用unordered_map代替hash_map
- 利用unordered_map代替hash_map
- hash_map将移除,需要用unordered_map代替hash_map
- hash_map->unordered_map
- map, hash_map,unordered_map介绍
- map, hash_map,unordered_map
- unordered_map map hash_map
- map, hash_map,unordered_map
- STL unordered_map(hash_map)详解
- hash_map,map,unordered_map效率
- map, hash_map,unordered_map
- map、hash_map和unordered_map
- map,hash_map, unordered_map
- hash_map,unordered_map的使用
- c++ map hash_map unordered_map 比较
- map hash_map unordered_map 性能测试
- map hash_map unordered_map 性能测试
- hash_map和unordered_map的使用
- js模块化require.js真的蛮有用
- linux中常用的一些命令
- mongodb查看当前操作db.currentOp()
- SparkStreaming基于Kafka Direct
- android 设置自定义dialog大小无效果
- 用unordered_map代替hash_map
- 魔兽世界任务制作教学,已经本人自己服务器中测试
- 一、OOP概念
- CocoPods的安装步骤
- 身份证号码生成
- SparkStreaming中Tanformations和状态管理
- 业务服务化给团队、技术带来的影响
- 浅谈Hibernate缓存机制:一级缓存、二级缓存
- 维基百科中凸函数的定义 Convex function