From fb2a877f961496e8657f7321c301862d67cd5451 Mon Sep 17 00:00:00 2001 From: isma-3788 <116300347+isma-3788@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:21:32 +0100 Subject: [PATCH] Moved definition of 'hash()' before use as it was causing some issues. --- minisat/mtl/Map.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/minisat/mtl/Map.h b/minisat/mtl/Map.h index a7da71ac..1de5b831 100644 --- a/minisat/mtl/Map.h +++ b/minisat/mtl/Map.h @@ -29,17 +29,16 @@ namespace Minisat { // Default hash/equals functions // -template struct Hash { uint32_t operator()(const K& k) const { return hash(k); } }; -template struct Equal { bool operator()(const K& k1, const K& k2) const { return k1 == k2; } }; - -template struct DeepHash { uint32_t operator()(const K* k) const { return hash(*k); } }; -template struct DeepEqual { bool operator()(const K* k1, const K* k2) const { return *k1 == *k2; } }; - static inline uint32_t hash(uint32_t x){ return x; } static inline uint32_t hash(uint64_t x){ return (uint32_t)x; } static inline uint32_t hash(int32_t x) { return (uint32_t)x; } static inline uint32_t hash(int64_t x) { return (uint32_t)x; } +template struct Hash { uint32_t operator()(const K& k) const { return hash(k); } }; +template struct Equal { bool operator()(const K& k1, const K& k2) const { return k1 == k2; } }; + +template struct DeepHash { uint32_t operator()(const K* k) const { return hash(*k); } }; +template struct DeepEqual { bool operator()(const K* k1, const K* k2) const { return *k1 == *k2; } }; //================================================================================================= // Some primes