mirror of
https://github.com/nlohmann/json.git
synced 2026-11-12 18:55:33 +00:00
deploy: cdfb130fa6
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -51,6 +51,8 @@ Comparing `NaN`
|
||||
1. Comparing a `NaN` with another `NaN`.
|
||||
1. Comparing a `NaN` and any other number.
|
||||
|
||||
For arrays and objects, the elements are compared in order. If the comparison reaches a `NaN` and a number (or another `NaN`) before any other difference, the result depends on the language standard. Before C++20, the pair counts as equivalent and the following elements (or the sizes) decide: for instance, `[NaN] < [1, NaN]` and `[1] <= [NaN]` are `true`. Since C++20, the whole comparison is unordered, and `<`, `<=`, `>`, and `>=` all yield `false`. Otherwise (for example `[1, NaN] < [2, NaN]`, or objects whose keys differ), the result is the same for all language standards. The same program can therefore order such values differently when it is compiled with a different language standard.
|
||||
|
||||
Operator overload resolution
|
||||
|
||||
Since C++20 overload resolution will consider the *rewritten candidate* generated from [`operator<=>`](https://json.nlohmann.me/api/basic_json/operator_spaceship/index.md).
|
||||
|
||||
Reference in New Issue
Block a user