Why does std::unordered_map have a reserve method?
The unordered_map container has a reserve method because it is implemented using buckets, and not a tree as in map. A bucket is: a slot in the container’s internal hash table to which elements are assigned based on the hash value of their key. Buckets are numbered from 0 to (bucket_count-1). (source) A single bucket … Read more