Skip to content

Commit

Permalink
Fix documentation error
Browse files Browse the repository at this point in the history
Move comparison before "j.clear()" function call, such that the intended return value "true" is actually correct.
  • Loading branch information
Jonathan Lee authored Jan 18, 2017
1 parent bae8e70 commit 046f6da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ const std::string tmp = j[0];
j[1] = 42;
bool foo = j.at(2);
// comparison
j == "[\"foo\", 1, true]"_json; // true
// other stuff
j.size(); // 3 entries
j.empty(); // false
Expand All @@ -277,9 +280,6 @@ j.is_object();
j.is_array();
j.is_string();
// comparison
j == "[\"foo\", 1, true]"_json; // true
// create an object
json o;
o["foo"] = 23;
Expand Down

0 comments on commit 046f6da

Please sign in to comment.