diff options
-rw-r--r-- | src/ChunkDef.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ChunkDef.h b/src/ChunkDef.h index b62656a58..959841ecc 100644 --- a/src/ChunkDef.h +++ b/src/ChunkDef.h @@ -399,9 +399,12 @@ public: typedef std::list<cChunkCoords> cChunkCoordsList; typedef std::vector<cChunkCoords> cChunkCoordsVector; +namespace std +{ + /** A simple hash function for chunk coords, we assume that chunk coords won't use more than 16 bits, so the hash is almost an identity. Used for std::unordered_map<cChunkCoords, ...> */ -template<> struct std::hash<cChunkCoords> +template<> struct hash<cChunkCoords> { size_t operator ()(const cChunkCoords & a_Coords) { @@ -409,6 +412,8 @@ template<> struct std::hash<cChunkCoords> } }; +} // namespace std + |