summaryrefslogtreecommitdiffhomepage
path: root/src/point.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/point.cpp')
-rw-r--r--src/point.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/point.cpp b/src/point.cpp
index 205e2a6a..772286cc 100644
--- a/src/point.cpp
+++ b/src/point.cpp
@@ -1,7 +1,21 @@
#include "point.hpp"
+#include "compat/int-hash.hpp"
namespace floormat {
+size_t point::hash() const
+{
+ constexpr size_t size = 2 * 2 + 1 + 1 + 2;
+ static_assert(sizeof *this == size);
+#ifdef FLOORMAT_64
+ static_assert(sizeof nullptr > 4);
+ return fnvhash_64(this, sizeof *this);
+#else
+ static_assert(sizeof nullptr == 4);
+ return fnvhash_32(this, sizeof *this);
+#endif
+}
+
Debug& operator<<(Debug& dbg, const point& pt)
{
const auto flags = dbg.flags();