mirror of
https://github.com/nlohmann/json.git
synced 2026-10-03 22:06:59 +01:00
46 lines
828 B
Markdown
46 lines
828 B
Markdown
# <small>nlohmann::json_pointer::</small>empty
|
|
|
|
```cpp
|
|
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"
|
|
```
|
|
|
|
## See also
|
|
|
|
- [front](front.md) return first reference token
|
|
- [back](back.md) return last reference token
|
|
- [to_string](to_string.md) return a string representation of the JSON pointer
|
|
|
|
## Version history
|
|
|
|
Added in version 3.6.0.
|