std :: multimap和std :: unordered_multimap多久会有一次shuffle条目?我问,因为我的代码传递引用以区分具有相同哈希的条目,并且我想知道何时对它们运行引用重定向功能.
如果我这样做会发生什么:
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)如果它是unordered_multimap,结果会有所不同吗?
返回传递引用以区分具有相同哈希的条目.有更安全的方法吗?
如果我删除其中一个条目,这些条目是否会移动(这是读取std :: vector文档的建议)?