aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Json.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2023-07-20 13:06:22 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2023-07-20 13:06:22 +0200
commit595606ca4ed3011af19c6d8a9f95519d84320120 (patch)
tree1f816921f27cce2e98ba7b61da7b68f1c269dd19 /lib/Json.cpp
parent2de7bab3cf1c7757078a113b35e927ecbccc5e3d (diff)
downloaddabmod-595606ca4ed3011af19c6d8a9f95519d84320120.tar.gz
dabmod-595606ca4ed3011af19c6d8a9f95519d84320120.tar.bz2
dabmod-595606ca4ed3011af19c6d8a9f95519d84320120.zip
Rework Json so that it works with map that doesn't support incomplete types
Diffstat (limited to 'lib/Json.cpp')
-rw-r--r--lib/Json.cpp5
1 files changed, 3 insertions, 2 deletions
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<std::nullopt_t>(value)) {
ss << "null";
}
- else if (std::holds_alternative<json::map_t>(value)) {
- ss << map_to_json(std::get<json::map_t>(value));
+ else if (std::holds_alternative<std::shared_ptr<json::map_t> >(value)) {
+ const map_t& v = *std::get<std::shared_ptr<json::map_t> >(value);
+ ss << map_to_json(v);
}
else {
throw std::logic_error("variant alternative not handled");