From 55fe3807c93769da3e63546a87327b6069fc8f5f Mon Sep 17 00:00:00 2001 From: Niels Date: Mon, 29 Jun 2015 23:20:33 +0200 Subject: [PATCH] small README fix --- README.md | 6 +++--- doc/examples/README.output | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 doc/examples/README.output diff --git a/README.md b/README.md index c32ddf91..54c2e71b 100644 --- a/README.md +++ b/README.md @@ -135,11 +135,11 @@ json j2 = { Note that in all these cases, you never need to "tell" the compiler which JSON value you want to use. If you want to be explicit or express some edge cases, the functions `json::array` and `json::object` will help: ```cpp -// ways to express the empty array [] -json empty_array_implicit = {{}}; +// a way to express the empty array [] json empty_array_explicit = json::array(); -// a way to express the empty object {} +// ways to express the empty object {} +json empty_object_implicit = json({}); json empty_object_explicit = json::object(); // a way to express an _array_ of key/value pairs [["currency", "USD"], ["value", 42.99]] diff --git a/doc/examples/README.output b/doc/examples/README.output new file mode 100644 index 00000000..3226f729 --- /dev/null +++ b/doc/examples/README.output @@ -0,0 +1,27 @@ +{ + "answer": { + "everything": 42 + }, + "happy": true, + "list": [ + 1, + 0, + 2 + ], + "name": "Niels", + "new": { + "key": { + "value": [ + "another", + "list" + ] + } + }, + "nothing": null, + "object": { + "currency": "USD", + "value": 42.99 + }, + "pi": 3.141, + "size": 9 +}