diff options
| author | Tatiana Borisova <tatiana.borisova@qt.io> | 2024-04-22 19:40:20 +0200 |
|---|---|---|
| committer | Tatiana Borisova <tatiana.borisova@qt.io> | 2024-05-22 23:32:56 +0000 |
| commit | ef964c254c7a72bc05b1f4f0c6f270f9ad21fecd (patch) | |
| tree | 22b6cf4801074e3ed8b8c52e8bfa0cb3026159e6 /src/network/kernel/qnetworkinterface_unix.cpp | |
| parent | bd0a6e83079efd8a26d9ece6055f584a8c89c1fd (diff) | |
QUuid, GUID: use new comparison helper macros
Replace public friend operators operator==(), operator!=(),
operator<(), etc of QUuid and GUID with friend methods
comparesEqual() / compareThreeWay().
Use Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE, because
the (in)equality operators are constexpr.
And then we use helper macros, because the other relational
operators are not constexpr. Cannot make relational operators
constexpr, because it requires to make variant() and isNull() methods
constexpr and QT_CORE_INLINE_SINCE. But the experiments
show that it does not work with adding constexpr to
QT_CORE_INLINE_SINCE.
Put relational operators under !QT_CORE_REMOVED_SINCE(6, 8) to prevent
an ambiguity. On Windows the metatype for QUuid is created
in removed_api.cpp. That leads to an ambiguity, and as a result
the compiler fails to create the equals methods of QMetaTypeInterface.
This, in turn, leads to the failed comparisons.
The usage of !QT_CORE_REMOVED_SINCE(6, 8) solves the problem.
Task-number: QTBUG-120304
Change-Id: I640bdeb8f1f7306ba06b9e4193d008cf2bb6dbfb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/network/kernel/qnetworkinterface_unix.cpp')
0 files changed, 0 insertions, 0 deletions
