Top "Unordered-map" questions

is a C++ class that is an associative container storing a combination of a key value and a mapped value allowing for quick retrieval of elements based on their keys.

C++ unordered_map using a custom class type as the key

I am trying to use a custom class as key for an unordered_map, like the following: #include <iostream&…

c++ hash g++ unordered-map hashtree
Is there any advantage of using map over unordered_map in case of trivial keys?

A recent talk about unordered_map in C++ made me realize that I should use unordered_map for most cases …

c++ performance dictionary unordered-map
Choosing between std::map and std::unordered_map

Now that std has a real hash map in unordered_map, why (or when) would I still want to use …

c++ c++11 hash map unordered-map
Obtaining list of keys and values from unordered_map

What is the most efficient way of obtaining lists (as a vector) of the keys and values from an unordered_…

c++ vector c++11 std unordered-map
Why can't I compile an unordered_map with a pair as key?

I am trying to create an unordered_map to map pairs with integers: #include <unordered_map> using namespace …

c++ dictionary unordered-map keyvaluepair
C++ Hash function for string in unordered_map

It seems as if C++ does not have a hash function for strings in the standard library. Is this true? …

c++ string c++11 key unordered-map
What is the default hash function used in C++ std::unordered_map?

I am using unordered_map<string, int> and unordered_map<int, int> What hash function is …

c++ c++11 hash stl unordered-map
What is the quickest way of inserting/updating std::unordered_map elements without using an if?

I currently have lots of code which looks like this: std::unordered_map<int,int> my_dict; . . . // If …

c++ performance unordered-map
Iterate through unordered map C++

I have wrote program which reads input until you hit ',' - COMA at the input. Then it counts …

c++ iterator unordered-map
How to choose between map and unordered_map?

Suppose I wanted to map data with a string as the key. What container should I have chosen, map or …

c++ dictionary data-structures stl unordered-map