> Every pair? Under what conditions do we need to implement heterogeneous
> comparisons, outside of the primitives?

Well, it was not a very precise wording from my side.
What I mean is that we need to handle every class with existing relational
operators. Which looks like a lot of work, and adding a new function overload
on top of it makes it even worse.
I also had in mind cases like "QPoint vs QPointF" or "QSize vs QSizeF",
but I now see that we do not explicitly provide operators for such comparisons.
Instead, we rely on the implicit constructors to do the conversion.

> BTW, this needs to integrate with QEqualityOperatorForType and
> QLessThanOperatorForType in qmetatype.h. I don't think there's any work for
> you other than verifying.

I was not even aware of them, thanks! A brief look at the code shows that
they shouldn't be affected, but I'll update the Jira ticket to keep them
in mind.

------------------------------

Ivan Solovev
Senior Software Engineer

The Qt Company GmbH
Erich-Thilo-Str. 10
12489 Berlin, Germany
ivan.solo...@qt.io
www.qt.io

Geschäftsführer: Mika Pälsi,
Juha Varelius, Jouni Lintunen
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht
Charlottenburg, HRB 144331 B
________________________________
From: Development <development-boun...@qt-project.org> on behalf of Edward 
Welbourne via Development <development@qt-project.org>
Sent: Tuesday, August 1, 2023 9:17 AM
To: Macieira, Thiago <thiago.macie...@intel.com>; development@qt-project.org 
<development@qt-project.org>
Subject: Re: [Development] C++20 comparisons @ Qt (was: Re: C++20 @ Qt)

On Monday, 31 July 2023 02:36:41 PDT Ivan Solovev via Development wrote:
>> Basically, what you suggest is that for every pair of comparable Qt
>> types we would need to double the amount of work that we do - provide
>> not only the helper functions for the macros, but also the overload
>> for some public functions for the end-users.

Thiago Macieira (31 July 2023 17:23) replied:
> Every pair? Under what conditions do we need to implement
> heterogeneous comparisons, outside of the primitives? Even with the
> primitives, I don't see more than a handful of heterogeneous, between
> integers and floating point, plus a few other dispatchers to avoid
> ambiguous lookups for integer to integer.

There'd also be our plethora of string types - but still, indeed, only a
fairly limited set of cross-type comparisons.

        Eddy.
--
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development
-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to