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

+6 -5
View File
@@ -6,13 +6,13 @@ Defined in header `<nlohmann/json_view.hpp>`
using json_editable_view = basic_json_view<json, view_mode::editable>;
```
This type is a [`basic_json_view`](https://json.nlohmann.me/api/basic_json_view/index.md) of a value of a [`json_editable_document`](https://json.nlohmann.me/api/json_editable_document/index.md). It offers the same read-only interface as [`json_view`](https://json.nlohmann.me/api/json_view/index.md); what is different is what it can be a view *of* -- a value that [`set`](https://json.nlohmann.me/api/basic_json_document/set/index.md) and [`push_back`](https://json.nlohmann.me/api/basic_json_document/push_back/index.md) can change, with every view still referring to it seeing the change, see [Edits](https://json.nlohmann.me/api/basic_json_document/#edits).
This type is a [`basic_json_view`](https://json.nlohmann.me/api/basic_json_view/index.md) of a value of a [`json_editable_document`](https://json.nlohmann.me/api/json_editable_document/index.md). It offers the same read-only interface as [`json_view`](https://json.nlohmann.me/api/json_view/index.md); what is different is what it can be a view *of* — a value that [`set`](https://json.nlohmann.me/api/basic_json_document/set/index.md) and [`push_back`](https://json.nlohmann.me/api/basic_json_document/push_back/index.md) can change, with every view still referring to it seeing the change, see [Edits](https://json.nlohmann.me/api/basic_json_document/#edits).
## Examples
Example
The example below is the same as [`json_editable_document`'s](https://json.nlohmann.me/api/json_editable_document/index.md): every view read back out of the document -- `doc.root()` and the views nested under it -- sees the edits made through `set`.
The example below is the same as [`json_editable_document`'s](https://json.nlohmann.me/api/json_editable_document/index.md): every view read back out of the document — `doc.root()` and the views nested under it — sees the edits made through `set`.
```
#include <iostream>
@@ -58,9 +58,10 @@ Output:
## See also
- [json_editable_document](https://json.nlohmann.me/api/json_editable_document/index.md) - the document type this view refers into
- [json_view](https://json.nlohmann.me/api/json_view/index.md) - the corresponding read-only view
- [ordered_json_editable_view](https://json.nlohmann.me/api/ordered_json_editable_view/index.md) - the corresponding view for `ordered_json_editable_document`
- [`json_editable_document`](https://json.nlohmann.me/api/json_editable_document/index.md) - the document type this view refers into
- [`json_view`](https://json.nlohmann.me/api/json_view/index.md) - the corresponding read-only view
- [`ordered_json_editable_view`](https://json.nlohmann.me/api/ordered_json_editable_view/index.md) - the corresponding view for `ordered_json_editable_document`
- [Zero-copy JSON views](https://json.nlohmann.me/features/json_view/#editing-a-document) - editing a document in place and writing it back
## Version history