I'm trying to implement a hash functionality for my objects in C++, since I want to access each element by it's key as fast as possible. I'm using unordered_map container and I've written custom hash and equality functions for my class.
My question is about how the unordered_map uses my custom hash function? It uses a basic modulo operation after summing two IP addresses and ports. After the modulo operation, the result is between 0 and X, where X is a large prime number. I know that an unordered_map starts with 10 buckets initially. Does this mean that it re-hashes the value returned from my hash function with a second modulo operation so that the values fit in 0-9? I also know that I can set the number of buckets to X. But I'm not sure that I'm using the unordered_map properly. Am i missing something?
Thanks.