diff --git a/src/utils/serialize.hpp b/src/utils/serialize.hpp index 977148e..eed2b53 100644 --- a/src/utils/serialize.hpp +++ b/src/utils/serialize.hpp @@ -17,6 +17,17 @@ namespace nl = nlohmann; namespace xv { +#ifdef _WIN32 + template + void serialize(nl::json& j, const std::optional>& p, const std::string& name) + { + if (p.has_value()) + { + std::visit([&](const auto& arg) { j[name] = arg; }, p.value()); + } + } +#endif + template void serialize(nl::json& j, const std::optional& p, const std::string& name) {