11 #include <boost/serialization/nvp.hpp>
12 #include <boost/serialization/split_free.hpp>
18 template<
class Archive,
class T>
19 void save(Archive &ar,
const std::optional<T> &o,
const unsigned int )
21 auto hasValue = o.has_value();
22 ar << BOOST_SERIALIZATION_NVP(hasValue);
25 const auto &value = o.value();
26 ar << BOOST_SERIALIZATION_NVP(value);
30 template<
class Archive,
class T>
31 void load(Archive &ar, std::optional<T> &o,
const unsigned int )
33 auto hasValue =
bool{};
34 ar >> BOOST_SERIALIZATION_NVP(hasValue);
40 ar >> BOOST_SERIALIZATION_NVP(value);
45 template<
class Archive,
47 inline void serialize(Archive &ar, std::optional<T> &o,
const unsigned int version)
49 boost::serialization::split_free(ar, o, 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