Skip to content

Commit

Permalink
Force cereal for serializing boost::unordered_map
Browse files Browse the repository at this point in the history
As of Boost 1.84, Boost provides its own serialize
method for unordered_map (to work with Boost.Serialize).
This conflicts with cereal's own functions which we
previously relied upon. Force use of the cereal
functions to remove this ambiguity.
  • Loading branch information
benmwebb committed Jan 31, 2024
1 parent 015844a commit b9b1819
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/kernel/include/set_map_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
#define IMP_KERNEL_LARGE_UNORDERED_SET boost::unordered_set
#define IMP_KERNEL_LARGE_UNORDERED_MAP boost::unordered_map

// Use cereal's own functions to serialize unordered_map, not those
// provided (for Boost.Serialize) in newer Boost versions
namespace cereal {
template<class Archive, class Key, class T>
struct specialize<Archive, boost::unordered_map<Key, T>,
cereal::specialization::non_member_load_save> {};
}

#if defined(_MSC_VER) && _MSC_VER <= 1500
#include <set> // IWYU pragma: export
#include <map> // IWYU pragma: export
Expand Down

0 comments on commit b9b1819

Please sign in to comment.