mirror of
https://github.com/nlohmann/json.git
synced 2026-07-11 13:05:11 +00:00
@@ -17,6 +17,8 @@ ValueType value(const json_pointer& ptr,
|
||||
const ValueType& default_value) const;
|
||||
```
|
||||
|
||||
This is equivalent to Python's `dict.get(key, default)`.
|
||||
|
||||
1. Returns either a copy of an object's element at the specified key `key` or a given default value if no element with
|
||||
key `key` exists.
|
||||
|
||||
@@ -50,10 +52,6 @@ ValueType value(const json_pointer& ptr,
|
||||
- Unlike [`operator[]`](operator[].md), this function does not implicitly add an element to the position defined by
|
||||
`key`/`ptr` key. This function is furthermore also applicable to const objects.
|
||||
|
||||
!!! note
|
||||
|
||||
This is equivalent to Python's `dict.get(key, default)`.
|
||||
|
||||
## Template parameters
|
||||
|
||||
`KeyType`
|
||||
|
||||
Reference in New Issue
Block a user