小编eag*_*101的帖子

关于C++中STL容器的问题

  1. std :: multimap和std :: unordered_multimap多久会有一次shuffle条目?我问,因为我的代码传递引用以区分具有相同哈希的条目,并且我想知道何时对它们运行引用重定向功能.

  2. 如果我这样做会发生什么:

    std::multimap atable; //Type specification stuff left out
    //Code that pus in two entries with the same key, call that key foo
    int bar = atable[foo];
    
    Run Code Online (Sandbox Code Playgroud)
  3. 如果它是unordered_multimap,结果会有所不同吗?

  4. 返回传递引用以区分具有相同哈希的条目.有更安全的方法吗?

  5. 如果我删除其中一个条目,这些条目是否会移动(这是读取std :: vector文档的建议)?

c++ stl unordered-map multimap c++11

3
推荐指数
1
解决办法
311
查看次数

标签 统计

c++ ×1

c++11 ×1

multimap ×1

stl ×1

unordered-map ×1