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 used in each case and what is chance of collision in each case? I will be inserting unique string and unique int as keys in each case respectively. I am interested in knowing the algorithm of hash function in case of string and int keys and their collision stats. The function object std::hash<> is used. Standard specializations exist for all built-in types, and some other standard library types such as std::string and std::thread . See the link for the full list. For other types to be used in a std: