How to change the key in an unordered_map?
问题 I need to use a data structure which supports constant time lookups on average. I think that using a std::unordered_map is a good way to do it. My data is a "collection" of numbers. |115|190|380|265| These numbers do not have to be in a particular order. I need to have about O(1) time to determine whether or not a given number exists in this data structure. I have the idea of using a std::unordered_map , which is actually a hash table (am I correct?). So the numbers will be keys, and then I