From 595606ca4ed3011af19c6d8a9f95519d84320120 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 20 Jul 2023 13:06:22 +0200 Subject: Rework Json so that it works with map that doesn't support incomplete types --- lib/Json.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/Json.cpp') diff --git a/lib/Json.cpp b/lib/Json.cpp index da5b078..121c2de 100644 --- a/lib/Json.cpp +++ b/lib/Json.cpp @@ -86,8 +86,9 @@ namespace json { else if (std::holds_alternative(value)) { ss << "null"; } - else if (std::holds_alternative(value)) { - ss << map_to_json(std::get(value)); + else if (std::holds_alternative >(value)) { + const map_t& v = *std::get >(value); + ss << map_to_json(v); } else { throw std::logic_error("variant alternative not handled"); -- cgit v1.2.3