mirror of
https://github.com/nlohmann/json.git
synced 2025-07-31 10:24:23 +03:00
Add documentation for comparing json and ordered_json (#3599)
* 📝 add documentation for #3443 * Apply suggestions from code review Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
This commit is contained in:
@ -99,6 +99,39 @@ Linear.
|
||||
}
|
||||
```
|
||||
|
||||
!!! note "Comparing different `basic_json` specializations"
|
||||
|
||||
Comparing different `basic_json` specializations can have surprising effects. For instance, the result of comparing
|
||||
the JSON objects
|
||||
|
||||
```json
|
||||
{
|
||||
"version": 1,
|
||||
"type": "integer"
|
||||
}
|
||||
```
|
||||
|
||||
and
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "integer",
|
||||
"version": 1
|
||||
}
|
||||
```
|
||||
|
||||
depends on whether [`nlohmann::json`](../json.md) or [`nlohmann::ordered_json`](../ordered_json.md) is used:
|
||||
|
||||
```cpp
|
||||
--8<-- "examples/operator__equal__specializations.cpp"
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
--8<-- "examples/operator__equal__specializations.output"
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
??? example
|
||||
|
Reference in New Issue
Block a user