What is the issue you have?
The documentation for operator == mentions that double NaN values compare unequal, and says, "To compare floating-point while respecting an epsilon, an alternative comparison function could be used..." The example function is for comparing two doubles.
In issue #514, about comparison between NaN values, @nlohmann wrote:
I think nothing must be changed here, only the documentation must be clear.
The documentation for operator == should illustrate how a custom double comparison function could be applied recursively to all values in a basic_json object. This would allow users to easily write their own function to evaluate two basic_json objects for equivalence.
I think such a function could be written using basic_json::flatten() and comparing items pairwise with the std::equal algorithm.
What is the issue you have?
The documentation for
operator ==mentions that double NaN values compare unequal, and says, "To compare floating-point while respecting an epsilon, an alternative comparison function could be used..." The example function is for comparing two doubles.In issue #514, about comparison between NaN values, @nlohmann wrote:
The documentation for
operator ==should illustrate how a custom double comparison function could be applied recursively to all values in abasic_jsonobject. This would allow users to easily write their own function to evaluate twobasic_jsonobjects for equivalence.I think such a function could be written using
basic_json::flatten()and comparing items pairwise with the std::equal algorithm.