From d6afaa8e168219d2809e8842314fe3dcd759318f Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 3 Feb 2017 18:15:37 +0100 Subject: [PATCH] :memo: fixing a documentation issue #442 --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cb91abb..43f428fc 100644 --- a/README.md +++ b/README.md @@ -166,8 +166,14 @@ auto j2 = R"( "pi": 3.141 } )"_json; +``` -// or explicitly +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. + +The above example can also be expressed explicitly using `json::parse()`: + +```cpp +// parse explicitly auto j3 = json::parse("{ \"happy\": true, \"pi\": 3.141 }"); ```