11 #include <boost/serialization/nvp.hpp>
12 #include <boost/serialization/split_free.hpp>
14 #include <immer/flex_vector.hpp>
15 #include <immer/flex_vector_transient.hpp>
19 template<
class Archive,
24 void save(Archive &ar,
const immer::flex_vector<T, MP, B, BL> &v,
const unsigned int )
27 ar << BOOST_SERIALIZATION_NVP(size);
29 for (
const auto &i : v) {
34 template<
class Archive,
39 void load(Archive &ar, immer::flex_vector<T, MP, B, BL> &v,
const unsigned int )
41 using VecT = immer::flex_vector<T, MP, B, BL>;
42 using TransientT = decltype(v.transient());
43 using SizeT = decltype(v.size());
44 using ValueT =
typename VecT::value_type;
47 ar >> BOOST_SERIALIZATION_NVP(size);
48 TransientT
transient = VecT(size).transient();
50 for (
auto i = SizeT{}; i != size; ++i) {
53 transient.set(i, std::move(val));
56 v =
transient.persistent();
59 template<
class Archive,
64 inline void serialize(Archive &ar, immer::flex_vector<T, MP, B, BL> &v,
const unsigned int version)
66 boost::serialization::split_free(ar, v, 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