[Development] C++20 comparisons @ Qt (was: Re: C++20 @ Qt)

Ulf Hermann ulf.hermann at qt.io
Fri Nov 4 12:13:16 CET 2022


Hi,

One thing I haven't understood about the ordering problem is why we 
cannot just define our "invalid" values to always be < any valid one and 
equal to other invalid ones. This way we get at least weak ordering for 
all our types and we're done.

There may be types where existing operator< work differently (*cough* 
QTypeRevision), but that just means we need to emulate that same 
behavior with the new operators.

Indeed the NaN behavior has always been a pain to deal with every time 
I've encountered it. If we have a chance to avoid it, we should.

What is the downside of such an approach?

best regards,
Ulf


More information about the Development mailing list