24 template <
class Archive,
class T>
25 void save(Archive& ar,
const std::optional<T>& opt)
27 bool hasVal = opt.has_value();
28 ar(CEREAL_NVP(hasVal));
31 const T& value = *opt;
32 ar(cereal::make_nvp(
"value", value));
39 template <
class Archive,
class T>
40 void load(Archive& ar, std::optional<T>& opt)
43 ar(CEREAL_NVP(hasVal));
47 ar(CEREAL_NVP(value));
48 opt = std::move(value);
59 template <
class Archive>
60 void save(Archive& ar,
const std::filesystem::path& path)
68 template <
class Archive>
69 void load(Archive& ar, std::filesystem::path& path)
73 path = std::filesystem::path(temp);