diff options
author | Tatiana Borisova <tatiana.borisova@qt.io> | 2024-04-24 11:31:09 +0200 |
---|---|---|
committer | Tatiana Borisova <tatiana.borisova@qt.io> | 2024-05-07 12:38:13 +0200 |
commit | a32c152d39e80277107cb62758f0bdac6b363b5d (patch) | |
tree | f8fb98f0ef3b786bef4227102ee645524fc1c056 | |
parent | 9928ebd26a3240c8fce6abc1bd339a6381af5e45 (diff) |
QSocketDescriptor: use modernize comparisons
Change-Id: Ic0389ab7f8578a0c224072097420cfd8cac508be
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
-rw-r--r-- | src/corelib/kernel/qsocketnotifier.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/kernel/qsocketnotifier.h b/src/corelib/kernel/qsocketnotifier.h index 8288a6b2b5..ac9e577ebc 100644 --- a/src/corelib/kernel/qsocketnotifier.h +++ b/src/corelib/kernel/qsocketnotifier.h @@ -83,20 +83,20 @@ public: Q_DECL_CONSTEXPR_NOT_WIN bool isValid() const noexcept { return *this != QSocketDescriptor(); } - friend Q_DECL_CONSTEXPR_NOT_WIN bool operator==(QSocketDescriptor lhs, - QSocketDescriptor rhs) noexcept +private: + friend Q_DECL_CONSTEXPR_NOT_WIN bool comparesEqual(const QSocketDescriptor &lhs, + const QSocketDescriptor &rhs) noexcept { return lhs.sockfd == rhs.sockfd; } - friend Q_DECL_CONSTEXPR_NOT_WIN bool operator!=(QSocketDescriptor lhs, - QSocketDescriptor rhs) noexcept - { - return lhs.sockfd != rhs.sockfd; - } +#if defined(Q_OS_WIN) || defined(Q_QDOC) + Q_DECLARE_EQUALITY_COMPARABLE(QSocketDescriptor) +#else + Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(QSocketDescriptor) +#endif #undef Q_DECL_CONSTEXPR_NOT_WIN -private: DescriptorType sockfd; }; |