简体   繁体   English

std::unordered_map 和 boost::unordered_map 有什么区别?

[英]What is the difference between std::unordered_map and boost::unordered_map?

I found both container used in our codes.我发现我们的代码中使用了这两个容器。 This is a bit of confusing, especially when I include libs that depends on both of them.这有点令人困惑,尤其是当我包含依赖于它们的库时。 So what is the main difference between these two implementations?那么这两种实现之间的主要区别是什么? Are they interchangeable in all cases?它们在所有情况下都可以互换吗? Or which should I prefer when I choose from them?或者当我从它们中选择时我应该更喜欢哪个?

unlike std counterpart boost::unordered_map (and probably other containers) allows using of incomplete types.与 std 对应的 boost::unordered_map(可能还有其他容器)不同,它允许使用不完整的类型。 that difference probably might change though, see for example https://www.reddit.com/r/cpp/comments/sykzng/since_when_does_gcc_support_stdunordered_map_with/不过,这种差异可能会改变,例如参见https://www.reddit.com/r/cpp/comments/sykzng/since_when_does_gcc_support_stdunordered_map_with/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM