taoshan Posted April 28, 2016 Report Share Posted April 28, 2016 hi , i must to add this commit for tdb 52 : https://github.com/TrinityCore/TrinityCore/commit/2da458c56d024aac04468ce2af454a83ad790bf6 but i have a error : The C++ Standard doesn't provide a hash for this type. Does anyone know how to convert this for compiler under VS 2013 ? typedef std::pair<int32, int32> coordinate; std::queue<coordinate> Q; std::unordered_set<coordinate> alreadyChecked; std::unordered_set<coordinate> outOfBounds; Link to comment Share on other sites More sharing options...
Naios Posted April 28, 2016 Report Share Posted April 28, 2016 You need to provide a custom hash function for the `coordinate` type since the compiler doesn't know how you want to hash this custom type: struct Hasher { std::size_t operator() (coordinate const& right) const { return ... ; } }; std::unordered_set<coordinate, Hasher> ... For hashing the two ints you could use std::hash and combine it using boost::hash::combine Link to comment Share on other sites More sharing options...
Recommended Posts