I\'m using clang (CXX=\'clang++ -std=c++11 -stdlib=libc++\') on Mac OS X, with boost 1.53.0.
I want to use uuid as keys in unordered_map, but getting the following e
Why bug in boost? You should specialize std::hash template for boost::uuid
.
#include
namespace std
{
template<>
struct hash
{
size_t operator () (const boost::uuids::uuid& uid)
{
return boost::hash()(uid);
}
};
}
or, simply create unordered_map
with boost::hash
par
std::unordered_map>
or provide hash
functor that satisfies requirements of std::hash
(thanks to Praetorian).