12 #include <boost/serialization/nvp.hpp>
13 #include <boost/serialization/split_free.hpp>
15 #include <immer/map.hpp>
20 template <
class Archive,
class K,
class T,
class H,
class E,
class MP>
21 void save(Archive &ar,
const immer::map<K, T, H, E, MP> &map,
const unsigned int )
23 auto size = map.size();
24 ar << BOOST_SERIALIZATION_NVP(size);
25 for (
const auto &[k, v] : map) {
30 template <
class Archive,
class K,
class T,
class H,
class E,
class MP>
31 void load(Archive &ar, immer::map<K, T, H, E, MP> &map,
const unsigned int )
35 using SizeT = decltype(map.size());
40 ar >> BOOST_SERIALIZATION_NVP(size);
42 for (
auto i = SizeT{}; i < size; ++i) {
46 map = std::move(map).set(std::move(k), std::move(v));
49 assert(size == map.size());
52 template<
class Archive,
class K,
class T,
class H,
class E,
class MP>
53 inline void serialize(Archive &ar, immer::map<K, T, H, E, MP> &m,
const unsigned int version)
55 boost::serialization::split_free(ar, m, version);
Definition: immer-array.hpp:18
void load(Archive &ar, immer::array< T, MP > &v, const unsigned int)
Definition: immer-array.hpp:35
void serialize(Archive &ar, immer::array< T, MP > &v, const unsigned int version)
Definition: immer-array.hpp:58
void save(Archive &ar, const immer::array< T, MP > &v, const unsigned int)
Definition: immer-array.hpp:22