Skip to content

Commit

Permalink
📝 fixing a documentation issue #442
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Feb 3, 2017
1 parent 5976caf commit d6afaa8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,14 @@ auto j2 = R"(
"pi": 3.141
}
)"_json;
```

Note that without appending the `_json` suffix, the passed string literal is not parsed, but just used as JSON string value. That is, `json j = "{ \"happy\": true, \"pi\": 3.141 }"` would just store the string `"{ "happy": true, "pi": 3.141 }"` rather than parsing the acutal object.

// or explicitly
The above example can also be expressed explicitly using `json::parse()`:

```cpp
// parse explicitly
auto j3 = json::parse("{ \"happy\": true, \"pi\": 3.141 }");
```

Expand Down

0 comments on commit d6afaa8

Please sign in to comment.