Files
json/docs/mkdocs/docs/api/ordered_json_editable_view.md
T
Niels Lohmann 266432ea65 json_view: view_mode enum instead of bool Editable, node_kind for node::kind
basic_json_document and basic_json_view take a view_mode (read_only, the
default, or editable) instead of a bool: basic_json_document<json, true>
did not say what true means. The shortcut aliases are unchanged.

The kind of a node is a node_kind (the value_t values plus link, 10 as
before), which removes the static_cast<std::uint8_t>(value_t::...) of
every comparison. The node and image layouts are unchanged.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-10-25 20:41:47 +01:00

1.3 KiB

nlohmann::ordered_json_editable_view

Defined in header <nlohmann/json_view.hpp>

using ordered_json_editable_view = basic_json_view<ordered_json, view_mode::editable>;

This type is a basic_json_view of a value of an ordered_json_editable_document, the corresponding view for ordered_json_view the way json_editable_view is for json_view.

Examples

??? example

The example below is the same as [`ordered_json_editable_document`'s](ordered_json_editable_document.md): the
views `set` returns see the document's member order preserved on `materialize()`, unlike for a
[`json_editable_document`](json_editable_document.md).

```cpp
--8<-- "examples/ordered_json_editable_document.cpp"
```

Output:

```json
--8<-- "examples/ordered_json_editable_document.output"
```

See also

Version history

Added in version 3.13.0.