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
Copy file name to clipboardExpand all lines: doc/basics.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,8 +77,7 @@ Once you have an element, you can navigate it with idiomatic C++ iterators, oper
77
77
78
78
***Extracting Values:** You can cast a JSON element to a native type: `double(element)` or
79
79
`double x = json_element`. This works for double, uint64_t, int64_t, bool,
80
-
dom::object and dom::array. An exception is thrown if the cast is not possible. You can also use is<*typename*>() to test if it is a
81
-
given type, or use the `type()` method: e.g., `element.type() == dom::element_type::DOUBLE`. Instead of casting, you can use get<*typename*>() to get the value: casts and get<*typename*>() can be used interchangeably. You can use a variant usage of get<*typename*>() with error codes to avoid exceptions: e.g.,
80
+
dom::object and dom::array. An exception is thrown if the cast is not possible. You can also use is<*typename*>() to test if it is a given type, or use the equivalent without templates (`is_uint64()`, `is_uint64()`, `is_number()`, `is_double()`, , `is_bool()`, `is_integer()`, `is_string()`, `is_array()`, `is_object()`) or use the `type()` method: e.g., `element.type() == dom::element_type::DOUBLE`. Instead of casting, you can use get<*typename*>() to get the value: casts and get<*typename*>() can be used interchangeably. You can also use equivalent functions without templates: e.g., `get_string()`, `get_int64()`, `get_uint64()`, `get_double()` and `get_bool()`. You can use a variant usage of get<*typename*>() with error codes to avoid exceptions: e.g.,
0 commit comments