mirror of
https://github.com/nlohmann/json.git
synced 2026-10-27 00:08:55 +00:00
The builder and the edit functions take and store a node_kind instead of casting a value_t; the numbering assertions and the comments now speak of node_kind, and the link kind notes that it follows value_t::discarded. The read-only aliases name view_mode::read_only like the editable ones. view_mode.md says the mode is a compile-time property of the type. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
1.1 KiB
1.1 KiB
nlohmann::ordered_json_document
Defined in header <nlohmann/json_view.hpp>
using ordered_json_document = basic_json_document<ordered_json, view_mode::read_only>;
This type is a basic_json_document of the ordered_json
specialization: materialize() on one of its views preserves the insertion order
of object keys, instead of sorting them like json_document does.
Examples
??? example
The example below demonstrates how `ordered_json_document` preserves the insertion order of object keys when
materializing.
```cpp
--8<-- "examples/ordered_json_document.cpp"
```
Output:
```json
--8<-- "examples/ordered_json_document.output"
```
See also
- ordered_json_view - a view of a value of an
ordered_json_document - json_document - the corresponding document for the default
jsonspecialization - Object Order
Version history
Added in version 3.13.0.