1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-24 02:21:01 +03:00

🚨 fixed a linter warning

This commit is contained in:
Niels Lohmann
2018-02-28 19:59:54 +01:00
parent 1f3d2a3be7
commit 5773e164bb
3 changed files with 13 additions and 0 deletions

View File

@ -168,6 +168,7 @@ TEST_CASE("README", "[hide]")
const std::string tmp = j[0];
j[1] = 42;
bool foo = j.at(2);
CHECK(foo == true);
// other stuff
j.size(); // 3 entries
@ -177,6 +178,7 @@ TEST_CASE("README", "[hide]")
// comparison
bool x = (j == "[\"foo\", 1, true]"_json); // true
CHECK(x == true);
// create an object
json o;
@ -257,17 +259,21 @@ TEST_CASE("README", "[hide]")
bool b1 = true;
json jb = b1;
bool b2 = jb;
CHECK(b2 == true);
// numbers
int i = 42;
json jn = i;
double f = jn;
CHECK(f == 42);
// etc.
std::string vs = js.get<std::string>();
bool vb = jb.get<bool>();
CHECK(vb == true);
int vi = jn.get<int>();
CHECK(vi == 42);
// etc.
}