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>();
167
+
double v = parser.parse(abstract_json)["str"]["123"]["abc"];
168
168
cout << "number: " << v << endl;
169
169
```
170
170
@@ -208,14 +208,13 @@ Your input string does not need any padding. Any string will do. The `validate_u
208
208
C++17 Support
209
209
-------------
210
210
211
-
While the simdjson library can be used in any project using C++ 11 and above, it has special support
212
-
for C++ 17. The APIs for field iteration and error handling in particular are designed to work
213
-
nicely with C++17's destructuring syntax. For example:
211
+
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))) {
297
285
std::cerr << "could not access keys" << std::endl;
298
286
return EXIT_FAILURE;
@@ -395,8 +383,7 @@ And another one:
395
383
cout << "number: " << v << endl;
396
384
```
397
385
398
-
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*.
399
-
386
+
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*.
400
387
401
388
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.
0 commit comments