
2012/2/1 Andrey Semashev <andrey.semashev@gmail.com>
On Wednesday, February 01, 2012 10:57:18 Howard Hinnant wrote:
As a judgement call, I calculated that I would have *many* more clients
are casual users of the std::unordered containers, defaulting most
who options
such as the hash function, than I would have clients interested in using std::hash<scalar> in their own containers, or in other places a hash function might be useful.
Thank you for your careful answer. As I understand, in order to compensate the std::hash simplicity you do additional hashing (bit mixing or modulus) in the container. May I ask, have you considered the other approach - to make the container simpler but add bit mixing to std::hash? Why you chose not to follow this path?
std::hash can be specialized for user defined types. If unordered containers were to assume that std::has does bit mixing, users would have harder time specializing std::hash which could lead to performance bugs. Roman Perepelitsa.