This commit is contained in:
nlohmann committed 2026-10-15 12:09:22 +00:00
1 parent dcc7a74a18
commit 98c9bea1d1
105 files changed
+537 -508

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ std::partial_ordering operator<=>(const ScalarType rhs) const noexcept(/* see be
- Two JSON values compare with a result of `std::partial_ordering::unordered` if either value is discarded.
- If both JSON values are of the same type, the result is produced by 3-way comparing their stored values using their respective `operator<=>`.
- Integer and floating-point numbers are converted to their common type and then 3-way compared using their respective `operator<=>`. For instance, comparing an integer and a floating-point value will 3-way compare the first value converted to floating-point with the second value.
- Integer and floating-point numbers are 3-way compared by their exact values, without converting the integer to floating-point. For instance, `9007199254740993` compares greater than `9007199254740992.0`.
- Otherwise, yields a result by comparing the type (see [`value_t`](https://json.nlohmann.me/api/basic_json/value_t/index.md)).
1. 3-way compares a JSON value and a scalar or a scalar and a JSON value by converting the scalar to a JSON value and 3-way comparing both JSON values (see 1).