From b9b18196d9b31165191068e1e3db3950d6883b86 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 31 Jan 2024 12:07:21 -0800 Subject: [PATCH] Force cereal for serializing boost::unordered_map 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. --- modules/kernel/include/set_map_macros.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/kernel/include/set_map_macros.h b/modules/kernel/include/set_map_macros.h index df95dc5d4b..66d6265075 100644 --- a/modules/kernel/include/set_map_macros.h +++ b/modules/kernel/include/set_map_macros.h @@ -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 + struct specialize, + cereal::specialization::non_member_load_save> {}; +} + #if defined(_MSC_VER) && _MSC_VER <= 1500 #include // IWYU pragma: export #include // IWYU pragma: export