From 4edb49300c178816d084c682ce6ff7fd654b9a89 Mon Sep 17 00:00:00 2001 From: Tymianek Date: Mon, 19 May 2025 16:56:11 +0200 Subject: [PATCH 1/2] Fix ambiguous operator[] --- cppjson/include/cppjson/object.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cppjson/include/cppjson/object.hpp b/cppjson/include/cppjson/object.hpp index 1599134..596bc85 100644 --- a/cppjson/include/cppjson/object.hpp +++ b/cppjson/include/cppjson/object.hpp @@ -98,6 +98,8 @@ namespace cppjson } ObjectProxy operator[](const std::string& key); + tempalte + ObjectProxy operator[](const char(&key)[N]) { return (*this)[std::string{key}]; } private: std::reference_wrapper _object; From 040b0d64090e8e89b8b6896487025b826eeeffe5 Mon Sep 17 00:00:00 2001 From: Tymianek Date: Mon, 19 May 2025 17:39:41 +0200 Subject: [PATCH 2/2] template typo lol --- cppjson/include/cppjson/object.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cppjson/include/cppjson/object.hpp b/cppjson/include/cppjson/object.hpp index 596bc85..7ac0f78 100644 --- a/cppjson/include/cppjson/object.hpp +++ b/cppjson/include/cppjson/object.hpp @@ -98,7 +98,7 @@ namespace cppjson } ObjectProxy operator[](const std::string& key); - tempalte + template ObjectProxy operator[](const char(&key)[N]) { return (*this)[std::string{key}]; } private: std::reference_wrapper _object;