nlohmann::ordered_json_document

Defined in header <nlohmann/json_view.hpp>

using ordered_json_document = basic_json_document<ordered_json>;

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

Version history

Added in version 3.13.0.