亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

利用unordered_map代替hash_map - My Study

系統(tǒng) 2493 0

利用unordered_map代替hash_map - My Study

利用unordered_map代替hash_map

  • 實驗環(huán)境
    1. 操作系統(tǒng) fedora9
    2. 編譯器版本 gcc4.3
  • 實驗方式
            各種map使用插入和查找,比較速度和相關(guān)性能
          
map類型 插入速度 插入和查找速度
hashmap 0m0.123s 0m0.369s
map 0m0.190s 0m0.681s
unordered_map 0m0.123s 0m0.315s

  • 為什么要使用unordered_map代替hash_map?
    • 因為標(biāo)準(zhǔn)化的推進(jìn),unordered_map原來屬于boost分支和std::tr1中,而hash_map屬于非標(biāo)準(zhǔn)容器。
    • 另外,使用之后,感覺速度和hash_map差不多,但是支持string做key,也可以使用復(fù)雜的對象作為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
*/

利用unordered_map代替hash_map - My Study


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦?。?!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 欧美亚洲国产人成aaa | 这里只有精品22 | 特黄日韩免费一区二区三区 | 中国美女bbbbbxxxxx | 国产精品免费视频能看 | 亚洲最新视频在线观看 | 亚洲综合色在线观看 | 草操影院| 久热re在线视频精品免费 | 福利在线观看视频 | 视频一区二区三区在线 | 成人午夜视频在线 | 四虎www成人影院免费观看 | 偷偷鲁影院手机在线观看 | 日日插日日操 | 青青青青爽视频在线播放 | 91在线操 | 天天草比 | 四虎免费在线观看 | 午夜影院网页 | 四虎影院新网址 | 日本草草视频 | 中文日韩欧美 | 99视频免费在线观看 | 久久天天躁夜夜躁狠狠85麻豆 | 香蕉tv亚洲专区在线观看 | 91精品国产91久久久久福利 | 婷婷亚洲五月 | 日本黄色不卡视频 | 亚洲综合区 | 手机看黄av免费网址 | 日韩一区二区精品久久高清 | 99这里只有精品6 | 一级毛片美国一级j毛片不卡 | 国产一区二区三区国产精品 | 成年女人午夜毛片免费看 | 欧美午夜精品久久久久免费视 | 午夜深夜福利网址 | 国内精品久久久久久久亚洲 | 四虎影视884a精品国产古代 | 天天干狠狠 |