From 63de5f8a555e3bd4b9309792e3a9c0dcb9e8f4b6 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 24 Dec 2014 08:38:37 +0100 Subject: Replaced a std::hash specialization with explicit type. std::hash is problematic in gcc / clang, one has a class, the other a struct. --- src/ChunkDef.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/ChunkDef.h') diff --git a/src/ChunkDef.h b/src/ChunkDef.h index 959841ecc..2bfa2949c 100644 --- a/src/ChunkDef.h +++ b/src/ChunkDef.h @@ -399,21 +399,17 @@ public: typedef std::list cChunkCoordsList; typedef std::vector 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 */ -template<> struct hash +class cChunkCoordsHash { - size_t operator ()(const cChunkCoords & a_Coords) +public: + size_t operator () (const cChunkCoords & a_Coords) const { return (static_cast(a_Coords.m_ChunkX) << 16) ^ static_cast(a_Coords.m_ChunkZ); } }; -} // namespace std - -- cgit v1.2.3