summaryrefslogtreecommitdiffstats
path: root/src/ChunkDef.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-24 08:38:37 +0100
committerMattes D <github@xoft.cz>2014-12-24 08:38:37 +0100
commit63de5f8a555e3bd4b9309792e3a9c0dcb9e8f4b6 (patch)
tree14af9578125c075eae3b57a7e56f25be605cc1a3 /src/ChunkDef.h
parentgcc compilation fix. (diff)
downloadcuberite-63de5f8a555e3bd4b9309792e3a9c0dcb9e8f4b6.tar
cuberite-63de5f8a555e3bd4b9309792e3a9c0dcb9e8f4b6.tar.gz
cuberite-63de5f8a555e3bd4b9309792e3a9c0dcb9e8f4b6.tar.bz2
cuberite-63de5f8a555e3bd4b9309792e3a9c0dcb9e8f4b6.tar.lz
cuberite-63de5f8a555e3bd4b9309792e3a9c0dcb9e8f4b6.tar.xz
cuberite-63de5f8a555e3bd4b9309792e3a9c0dcb9e8f4b6.tar.zst
cuberite-63de5f8a555e3bd4b9309792e3a9c0dcb9e8f4b6.zip
Diffstat (limited to 'src/ChunkDef.h')
-rw-r--r--src/ChunkDef.h10
1 files changed, 3 insertions, 7 deletions
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<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 hash<cChunkCoords>
+class cChunkCoordsHash
{
- size_t operator ()(const cChunkCoords & a_Coords)
+public:
+ size_t operator () (const cChunkCoords & a_Coords) const
{
return (static_cast<size_t>(a_Coords.m_ChunkX) << 16) ^ static_cast<size_t>(a_Coords.m_ChunkZ);
}
};
-} // namespace std
-