Saturday, 31 August 2013

How to directly use key as hash for std::unordered_map?

How to directly use key as hash for std::unordered_map?

The keys in my std::unordered_map are boost::uuids::uuids, thus 128 bit
hashes considered unique. However, the compiler can't know that and
therefore says this.
error C2338: The C++ Standard doesn't provide a hash for this type.
How can I make the map use the keys as hashes as they are?

No comments:

Post a Comment