File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ int main()
55{
66 cppjson::Object object{};
77 std::println (" {}" , object);
8- object[" test" ] = " Hello World" ;
8+ object[" test1" ] = " Hello World" ;
9+ object[" test2" ] = 123.0 ;
910 std::println (" {}" , object);
1011}
Original file line number Diff line number Diff line change @@ -68,13 +68,13 @@ namespace cppjson
6868 explicit ObjectProxy (JsonObject& object) : _object(std::ref(object)) {}
6969
7070 template <typename T>
71- operator T&()
71+ explicit ( false ) operator T&()
7272 {
7373 return this ->_object .get ().As <T>();
7474 }
7575
7676 template <typename T>
77- operator const T&() const
77+ explicit ( false ) operator const T&() const
7878 {
7979 return this ->_object .get ().As <T>();
8080 }
@@ -100,7 +100,7 @@ namespace cppjson
100100 public:
101101 explicit ConstObjectProxy (const JsonObject& object) : _object(std::ref(object)) {}
102102 template <typename T>
103- operator const T&() const
103+ explicit ( false ) operator const T&() const
104104 {
105105 return this ->_object .get ().As <T>();
106106 }
You can’t perform that action at this time.
0 commit comments