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
@@ -191,14 +191,13 @@ Though it does not validate the JSON input, it will detect when the document end
191
191
C++17 Support
192
192
-------------
193
193
194
-
While the simdjson library can be used in any project using C++ 11 and above, it has special support
195
-
for C++ 17. The APIs for field iteration and error handling in particular are designed to work
196
-
nicely with C++17's destructuring syntax. For example:
194
+
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:
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*.
382
-
379
+
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*.
383
380
384
381
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