File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -53,18 +53,19 @@ You can also programmatically create `json::value` objects like this:
5353
5454``` c++
5555int main (int argc, char * argv[ ] ) {
56- json::array arr = {
56+ auto arr = json::array {
5757 1,
5858 2,
5959 3,
6060 4,
61- "Testing 1 2 3", json::object{
61+ "Testing 1 2 3",
62+ json::object{
6263 { "hello", 1234 },
6364 { "world", 5678 }
6465 }
6566 };
66-
67- std::cout << stringify(arr) << std::endl;
67+
68+ std::cout << stringify(arr) << std::endl;
6869}
6970```
7071
@@ -76,7 +77,8 @@ Which of course results in a object representing the following JSON:
7677 2,
7778 3,
7879 4,
79- "Testing 1 2 3", {
80+ "Testing 1 2 3",
81+ {
8082 "hello" : 1234,
8183 "world" : 5678
8284 }
Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ int main() {
1313 2 ,
1414 3 ,
1515 4 ,
16- " Testing 1 2 3" , json::object{
16+ " Testing 1 2 3" ,
17+ json::object{
1718 { " hello" , 1234 },
1819 { " world" , 5678 }
1920 }
2021 };
22+
2123 std::cout << stringify (arr) << std::endl;
2224}
You can’t perform that action at this time.
0 commit comments