diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-10-12 11:34:58 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-10-12 11:40:27 +0200 |
| commit | 9ce86d2bc8d4260709c41eeffc8922bc51bcf865 (patch) | |
| tree | 87768fef83a3961a2d971f34946f4231f8cf9af4 /src/point.cpp | |
| parent | bc91a0f610bd50872437dc7ed85923488e93e3d7 (diff) | |
bbb
Diffstat (limited to 'src/point.cpp')
| -rw-r--r-- | src/point.cpp | 14 |
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(); |
