diff --git a/examples/serialize.cc b/examples/serialize.cc index d6b836f..a9adcf4 100644 --- a/examples/serialize.cc +++ b/examples/serialize.cc @@ -1,17 +1,21 @@ #include #include #include -#include "parallel_hashmap/phmap_dump.h" #define USE_CEREAL 0 #if USE_CEREAL + #define PHMAP_DISABLE_DUMP // this is needed because the cereal doesn't like our hash map to have a dump() function + #include "cereal/types/unordered_map.hpp" #include "cereal/types/memory.hpp" #include "cereal/types/bitset.hpp" #include "cereal/archives/binary.hpp" #include #endif + +#include "parallel_hashmap/phmap_dump.h" + #include #include #include diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index cc37297..714f571 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -1576,7 +1576,7 @@ public: } } -#ifndef PHMAP_NON_DETERMINISTIC +#if !defined(PHMAP_NON_DETERMINISTIC) && !defined(PHMAP_DISABLE_DUMP) template bool dump(OutputArchive&) const; @@ -3366,7 +3366,7 @@ public: return HashElement{hash_ref()}(key); } -#ifndef PHMAP_NON_DETERMINISTIC +#if !defined(PHMAP_NON_DETERMINISTIC) && !defined(PHMAP_DISABLE_DUMP) template bool dump(OutputArchive& ar) const; diff --git a/parallel_hashmap/phmap_dump.h b/parallel_hashmap/phmap_dump.h index 0f2018e..c5f3817 100644 --- a/parallel_hashmap/phmap_dump.h +++ b/parallel_hashmap/phmap_dump.h @@ -42,6 +42,8 @@ struct IsTriviallyCopyable> { namespace priv { +#if !defined(PHMAP_NON_DETERMINISTIC) && !defined(PHMAP_DISABLE_DUMP) + // ------------------------------------------------------------------------ // dump/load for raw_hash_set // ------------------------------------------------------------------------ @@ -166,6 +168,9 @@ bool parallel_hash_set::load(InputArch } return true; } + +#endif // !defined(PHMAP_NON_DETERMINISTIC) && !defined(PHMAP_DISABLE_DUMP) + } // namespace priv