开发者

What bit hash function does unordered_map use?

开发者 https://www.devze.com 2023-03-26 15:09 出处:网络
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 b

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消