Is the unordered_map really unordered?

前端 未结 5 2023
悲哀的现实
悲哀的现实 2020-12-06 06:07

I am very confused by the name \'unordered_map\'. The name suggests that the keys are not ordered at all. But I always thought they are ordered by their hash value. Or is th

5条回答
  •  抹茶落季
    2020-12-06 06:37

    As the name unordered_map suggests, no ordering is specified by the C++0x standard. An unordered_map's apparent ordering will be dependent on whatever is convenient for the actual implementation.

提交回复
热议问题