Skip to content

Commit

Permalink
test ugly fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Jun 5, 2024
1 parent 8611fde commit f025dfc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/utils/serialize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ namespace nl = nlohmann;

namespace xv
{
#ifdef _WIN32
template <class... T>
void serialize(nl::json& j, const std::optional<std::variant<T...>>& p, const std::string& name)
{
if (p.has_value())
{
std::visit([&](const auto& arg) { j[name] = arg; }, p.value());
}
}
#endif

template <class T>
void serialize(nl::json& j, const std::optional<T>& p, const std::string& name)
{
Expand Down

0 comments on commit f025dfc

Please sign in to comment.