mirror of
https://github.com/nlohmann/json
synced 2024-11-10 06:20:06 +00:00
small README fix
This commit is contained in:
parent
5ae2babf61
commit
55fe3807c9
@ -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]]
|
||||
|
27
doc/examples/README.output
Normal file
27
doc/examples/README.output
Normal file
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user