News for hackers. Stuff that matters.
Re:Comparisons in C++20 by contravariant on Monday July 29, 2019 @04:35AM (#20552590)
I reckon that having a single operator would make it easier to pass through a custom comparer to whatever function you need. That is probably a better option than changing the default <=> of a type.

For what it's worth the mathematical definition of partial orders suggests having NaN equivalent to NaN. You're not really forced to but giving up reflexivity doesn't seem worth it (unless you want to view each NaN a it's own object).

Interestingly mathematics only defines <= for a specific kind of object. Although on it's own this doesn't give you much information about what kind of relation it is.

There are no comments on this comment yet.