Commit 046f6da8 by Jonathan Lee Committed by GitHub

Fix documentation error

Move comparison before "j.clear()" function call, such that the intended return value "true" is actually correct.
parent bae8e701
...@@ -263,6 +263,9 @@ const std::string tmp = j[0]; ...@@ -263,6 +263,9 @@ const std::string tmp = j[0];
j[1] = 42; j[1] = 42;
bool foo = j.at(2); bool foo = j.at(2);
// comparison
j == "[\"foo\", 1, true]"_json; // true
// other stuff // other stuff
j.size(); // 3 entries j.size(); // 3 entries
j.empty(); // false j.empty(); // false
...@@ -277,9 +280,6 @@ j.is_object(); ...@@ -277,9 +280,6 @@ j.is_object();
j.is_array(); j.is_array();
j.is_string(); j.is_string();
// comparison
j == "[\"foo\", 1, true]"_json; // true
// create an object // create an object
json o; json o;
o["foo"] = 23; o["foo"] = 23;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment