From f34b705d55d52a6c642e907ee491535679a782df Mon Sep 17 00:00:00 2001 From: Nathan Phillips Date: Mon, 8 May 2017 14:06:15 +0100 Subject: [PATCH] Moved vector_hasht implementation into cpp file This breaks the need to have irep_hash.h included here, which then propagates it elsewhere, which is good as it defines a macro that clashes with Boost --- src/util/irep_hash_container.cpp | 22 ++++++++++++++++++++++ src/util/irep_hash_container.h | 9 +-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/util/irep_hash_container.cpp b/src/util/irep_hash_container.cpp index c79d7a921ba..5d17b3d3f9f 100644 --- a/src/util/irep_hash_container.cpp +++ b/src/util/irep_hash_container.cpp @@ -8,6 +8,7 @@ Author: Daniel Kroening, kroening@kroening.com #include "irep_hash_container.h" #include "irep.h" +#include "irep_hash.h" /*******************************************************************\ @@ -41,6 +42,27 @@ size_t irep_hash_container_baset::number(const irept &irep) /*******************************************************************\ +Function: irep_hash_container_baset::vector_hasht::operator() + + Inputs: + + Outputs: + + Purpose: + +\*******************************************************************/ + +size_t irep_hash_container_baset::vector_hasht::operator()( + const packedt &p) const +{ + size_t result=p.size(); // seed + for(auto elem : p) + result=hash_combine(result, elem); + return result; +} + +/*******************************************************************\ + Function: irep_hash_container_baset::pack Inputs: diff --git a/src/util/irep_hash_container.h b/src/util/irep_hash_container.h index 4b6c43454a9..6edaaf0c21c 100644 --- a/src/util/irep_hash_container.h +++ b/src/util/irep_hash_container.h @@ -12,7 +12,6 @@ Author: Daniel Kroening, kroening@kroening.com #include // for size_t #include -#include "irep_hash.h" #include "numbering.h" class irept; @@ -55,13 +54,7 @@ class irep_hash_container_baset struct vector_hasht { - size_t operator()(const packedt &p) const - { - size_t result=p.size(); // seed - for(auto elem : p) - result=hash_combine(result, elem); - return result; - } + size_t operator()(const packedt &p) const; }; typedef hash_numbering numberingt;