From 03efe856012a55165542a3ac5c9055c25723f5e8 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Sun, 26 Jun 2022 11:59:57 -0400 Subject: add upstream 11.22 --- zen/json.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'zen/json.h') diff --git a/zen/json.h b/zen/json.h index 6cfd3bb3..3a9d73f3 100644 --- a/zen/json.h +++ b/zen/json.h @@ -22,8 +22,8 @@ struct JsonValue boolean, //primitive types number, // string, // - object, array, + object, }; /**/ JsonValue() {} @@ -40,9 +40,10 @@ struct JsonValue Type type = Type::null; - std::string primVal; //for primitive types - std::unordered_map objectVal; //"[...] most implementations of JSON libraries do not accept duplicate keys [...]" => fine! - std::vector arrayVal; + std::string primVal; //for primitive types + std::vector arrayVal; + std::map objectVal; //"[...] most implementations of JSON libraries do not accept duplicate keys [...]" => fine! + //alternative: std::unordered_map => but let's keep std::map, so that objectVal is sorted for our unit tests }; -- cgit