c++unordered_map扩容

 1 #include <iostream>
 2 #include <string>
 3 #include <unordered_map>
 4 using namespace std;
 5 
 6 int main()
 7 {  
 8     unordered_map<int , string> ump;
 9     for(int i=0; i<190; i++)
10     {
11         ump.insert(pair<int, string>(i, "amy"));
12         cout << "插入 " << i << " - ";
13         cout << "桶数量" << ump.bucket_count() << " - ";
14         cout << "最大桶数量" << ump.bucket_count() << endl;
15     }
16     return 0;
17 }

c++unordered_map扩容

 

 c++unordered_map扩容c++unordered_map扩容

 

 

 应该不同的编译器的初始值是不同的,但是应该都是找到不小于2倍的最小素数

原文链接: https://www.cnblogs.com/hxl-learning-space/p/14907663.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

    c++unordered_map扩容

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/211522

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月13日 上午12:50
下一篇 2023年2月13日 上午12:51

相关推荐