]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | # <small>nlohmann::basic_json::</small>is_object |
2 | ||
3 | ```cpp | |
4 | constexpr bool is_object() const noexcept; | |
5 | ``` | |
6 | ||
7 | This function returns `#!cpp true` if and only if the JSON value is an object. | |
8 | ||
9 | ## Return value | |
10 | ||
11 | `#!cpp true` if type is an object, `#!cpp false` otherwise. | |
12 | ||
13 | ## Exception safety | |
14 | ||
15 | No-throw guarantee: this member function never throws exceptions. | |
16 | ||
17 | ## Complexity | |
18 | ||
19 | Constant. | |
20 | ||
21 | ## Examples | |
22 | ||
23 | ??? example | |
24 | ||
25 | The following code exemplifies `is_object()` for all JSON types. | |
26 | ||
27 | ```cpp | |
28 | --8<-- "examples/is_object.cpp" | |
29 | ``` | |
30 | ||
31 | Output: | |
32 | ||
33 | ```json | |
34 | --8<-- "examples/is_object.output" | |
35 | ``` | |
36 | ||
37 | ## Version history | |
38 | ||
39 | - Added in version 1.0.0. |