Files
json/docs/mkdocs/docs/api/json_pointer/empty.md
T
Niels Lohmann 4424a0fcc1 📝 update documentation (#4723)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-05 18:54:35 +02:00

640 B

nlohmann::json_pointer::empty

bool empty() const noexcept;

Return whether the pointer points to the root document.

Return value

#!cpp true iff the JSON pointer points to the root document.

Exception safety

No-throw guarantee: this function never throws exceptions.

Complexity

Constant.

Examples

??? example

The example shows the result of `empty` for different JSON Pointers.
 
```cpp
--8<-- "examples/json_pointer__empty.cpp"
```

Output:

```json
--8<-- "examples/json_pointer__empty.output"
```

Version history

Added in version 3.6.0.