I want to write my own Hash_function for an std::unordered_map instead of using the default one. I could find unordered_map::hash_function() on many websites. But using this i can only get the Hash value generated, using something like this :
/*Sample map of strings*/
unordered_map<string, string> sample;
// inserts key and elements
sample.insert({ "Tom", "MNNIT" });
sample.insert({ "Kate", "MNNIT" });
unordered_map<string, string>::hasher foo
= sample.hash_function();
cout << foo("Tom") << endl;
But how can i have more control and create my own version of the hashing function ? So, that for example lets say for the key "Tom", i want hash value to be 100.