Skip to content

Commit

Permalink
QSocketDescriptor: use modernize comparisons
Browse files Browse the repository at this point in the history
Change-Id: Ic0389ab7f8578a0c224072097420cfd8cac508be
Reviewed-by: Ivan Solovev <[email protected]>
  • Loading branch information
qt-tatiana committed May 7, 2024
1 parent 9928ebd commit a32c152
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/corelib/kernel/qsocketnotifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,20 @@ class QSocketDescriptor

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;
};

Expand Down

0 comments on commit a32c152

Please sign in to comment.