Does copy of unordered_map will have exactly same buckets

拥有回忆 提交于 2019-12-06 07:37:39

The max load factor, but not the "current" load factor are specified as being copied when an unordered_map is copied.

Both the entry for copy construction and copy assignment include the following

In addition to the requirements of Table 64, copies the hash function, predicate, and maximum load factor.

[unord.req]

In general this means there may be a different count of buckets, and thus a different distribution of elements into buckets in a copy.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!