我正在尝试对 64 位整数进行哈希处理,
uint64_t temp = ...;
return tr1::hash<uint64_t>(temp);
但是我收到错误,
error: no matching function for call to ‘std::tr1::hash<long long unsigned int>::hash(uint64_t&)’
为什么这不起作用?
最佳答案
hash
是一个类。你必须创建一个对象:
return std::tr1::hash<uint64_t>()(temp);
// ^^^^
关于c++ - uint64_t 的 tr1::hash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12715498/