1
0
mirror of https://github.com/nlohmann/json synced 2024-12-17 22:51:07 +00:00

minor changes

This commit is contained in:
Niels 2015-01-06 19:14:03 +01:00
parent d84f8ebb02
commit 08456b8ff0
2 changed files with 9 additions and 2 deletions

View File

@ -115,7 +115,11 @@ You can create an object (deserialization) by appending `_json` to a string lite
json j = "{ \"pi\": 3.141, \"happy\": true }"_json;
// or even nicer (thanks http://isocpp.org/blog/2015/01/json-for-modern-cpp)
auto j2 = R"( {"pi": 3.141, "happy": true} )"_json;
auto j2 = R"(
{
"pi": 3.141,
"happy": true
})"_json;
```
You can also get a string representation (serialize):

View File

@ -1778,7 +1778,10 @@ TEST_CASE("Parser")
auto j3 = "{\"key\": \"value\"}"_json;
CHECK(j3["key"] == "value");
auto j22 = R"({"pi": 3.141, "happy": true })"_json;
auto j22 = R"({
"pi": 3.141,
"happy": true
})"_json;
auto j23 = "{ \"pi\": 3.141, \"happy\": true }"_json;
CHECK(j22 == j23);
}