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()
5
5
{
6
6
cppjson::Object object{};
7
7
std::println (" {}" , object);
8
- object[" test" ] = " Hello World" ;
8
+ object[" test1" ] = " Hello World" ;
9
+ object[" test2" ] = 123.0 ;
9
10
std::println (" {}" , object);
10
11
}
Original file line number Diff line number Diff line change @@ -68,13 +68,13 @@ namespace cppjson
68
68
explicit ObjectProxy (JsonObject& object) : _object(std::ref(object)) {}
69
69
70
70
template <typename T>
71
- operator T&()
71
+ explicit ( false ) operator T&()
72
72
{
73
73
return this ->_object .get ().As <T>();
74
74
}
75
75
76
76
template <typename T>
77
- operator const T&() const
77
+ explicit ( false ) operator const T&() const
78
78
{
79
79
return this ->_object .get ().As <T>();
80
80
}
@@ -100,7 +100,7 @@ namespace cppjson
100
100
public:
101
101
explicit ConstObjectProxy (const JsonObject& object) : _object(std::ref(object)) {}
102
102
template <typename T>
103
- operator const T&() const
103
+ explicit ( false ) operator const T&() const
104
104
{
105
105
return this ->_object .get ().As <T>();
106
106
}
You can’t perform that action at this time.
0 commit comments