This commit is contained in:
nlohmann committed 2026-10-27 12:14:00 +00:00
1 parent b36f8a9821
commit 11a863958e
1180 files changed
+14211 -6025

No files matched your search

@@ -125,3 +125,13 @@ for (int i = 0; i < 1000; ++i) {
| access to valid array index | reference to existing value is returned | const reference to existing value is returned |
| access to non-existing object key | reference to newly inserted `#!json null` value is returned | **undefined behavior**; [runtime assertion](../assertions.md) in debug mode |
| access to invalid array index | reference to newly inserted `#!json null` value is returned; any index between previous maximal index and passed index are filled with `#!json null` | **undefined behavior**; [runtime assertion](../assertions.md) in debug mode |
<p class="nj-table-caption" markdown>Result of [`operator[]`](../../api/basic_json/operator%5B%5D.md) in each scenario, for a non-const and a const value.</p>
## See also
- [Element Access](index.md) - overview of all ways to access elements
- [Checked access: at](checked_access.md) - access with range checking
- [Access with default value: value](default_value.md) - fall back to a default instead of throwing
- [`operator[]`](../../api/basic_json/operator%5B%5D.md) - unchecked access by reference
- [Runtime assertions](../assertions.md) - assertions that guard `operator[]` misuse