struct KeyHasher
{
std::size_t operator()(const std::pair<unsigned int, unsigned int>& k) const
{
using std::size_t;
using std::hash;
return ((hash<unsigned int>()(k.first)
^ (hash<unsigned int>()(k.second) << 8)) >> 8);
}
};
unordered_map<std::pair<unsigned int, unsigned int>, bool, KeyHasher> info;
unordered_map 非内置类型自定义hash
最新推荐文章于 2025-05-19 18:20:50 发布