mirror of
https://github.com/nlohmann/json.git
synced 2026-07-11 21:15:10 +00:00
Overwork documentation (#4516)
This commit is contained in:
@@ -34,6 +34,15 @@ const_reference operator[](const json_pointer& ptr) const;
|
||||
[`string_t`](string_t.md) using [`object_comparator_t`](object_comparator_t.md).
|
||||
This can also be a string view (C++17).
|
||||
|
||||
## Iterator invalidation
|
||||
|
||||
For the non-const versions 1. and 4., when passing an **array** index that does not exist, it is created and filled with
|
||||
a `#!json null` value before a reference to it is returned. For this, a reallocation can happen, in which case all
|
||||
iterators (including the [`end()`](end.md) iterator) and all references to the elements are invalidated.
|
||||
|
||||
For [`ordered_json`](../ordered_json.md), also passing an **object key** to the non-const versions 2., 3., and 4., a
|
||||
reallocation can happen which again invalidates all iterators and all references.
|
||||
|
||||
## Parameters
|
||||
|
||||
`idx` (in)
|
||||
|
||||
Reference in New Issue
Block a user