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

Thiago Macieira thiago.macieira at intel.com
Thu Nov 3 16:17:28 CET 2022


On Thursday, 3 November 2022 02:40:51 PDT Marc Mutz via Development wrote:
> This would be much easier done with an ABI break, but we have the tools
> (QT_REMOVED_SINCE) now to deal with this already now.
> 
> If we also make all these operators hidden friends
> (https://bugreports.qt.io/browse/QTBUG-87973), then we at the same time
> improve the user experience by removing overly-verbose error messages
> when something goes wrong. If we do this, though, some incidental
> comparisons that rely on implicit conversions will stop working. This is
> a good thing, IMO, because it forces us to provide (and therefore
> document) these operators explicitly.
> 
> The process will also force us to (at least mentally) assign level
> numbers to heterogeneously-comparable classes. This might run into
> problems (such as QTBUG-108136), but is overall a good thing.
> 
> Opinions? Comments?

This one is also a nice improvement and I'd welcome it, but the devil will be 
in the details because of QT_REMOVED_SINCE. For some classes, we could 
postpone changing anything until C++20 is required. Meanwhile, we have 
qcompare.h.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering





More information about the Development mailing list