You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
double v = parser.parse(abstract_json)["str"]["123"]["abc"].get<double>();
166
+
double v = parser.parse(abstract_json)["str"]["123"]["abc"];
167
167
cout << "number: " << v << endl;
168
168
```
169
169
@@ -207,14 +207,13 @@ Your input string does not need any padding. Any string will do. The `validate_u
207
207
C++17 Support
208
208
-------------
209
209
210
-
While the simdjson library can be used in any project using C++ 11 and above, it has special support
211
-
for C++ 17. The APIs for field iteration and error handling in particular are designed to work
212
-
nicely with C++17's destructuring syntax. For example:
210
+
While the simdjson library can be used in any project using C++ 11 and above, field iteration has special support C++ 17's destructuring syntax. For example:
if ((error = tweets["search_metadata"]["count"].get(res))) {
296
284
std::cerr << "could not access keys" << std::endl;
297
285
return EXIT_FAILURE;
@@ -394,8 +382,7 @@ And another one:
394
382
cout << "number: " << v << endl;
395
383
```
396
384
397
-
Notice how we can string several operation (`parser.parse(abstract_json)["str"]["123"]["abc"].get<double>()`) and only check for the error once, a strategy we call *error chaining*.
398
-
385
+
Notice how we can string several operations (`parser.parse(abstract_json)["str"]["123"]["abc"].get(v)`) and only check for the error once, a strategy we call *error chaining*.
399
386
400
387
The next two functions will take as input a JSON document containing an array with a single element, either a string or a number. They return true upon success.
401
388
@@ -505,7 +492,8 @@ Here is a simple example, given "x.json" with this content:
505
492
506
493
```c++
507
494
dom::parser parser;
508
-
for (dom::element doc : parser.load_many(filename)) {
0 commit comments