Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试散列一个 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是一类。你必须制作一个对象:
hash
return std::tr1::hash<uint64_t>()(temp); // ^^^^