What bit hash function does unordered_map use?
What bit hash does unordered_map
of C++0x
use by default? std::hash
function 开发者_开发问答returns size_t
. Does that mean unordered_map
uses a 16 bit hash function?
std::unordered_set
uses std::hash
by default.
If std::size_t
is 16-bit for you, then I guess it does use a 16-bit hash. On a 16-bit machine, I'd expect unordered_map::max_size()
to be low enough that using such a weak hash wouldn't be a problem.
精彩评论