diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-07-01 14:08:07 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-07-16 07:38:48 +0000 |
commit | 0dd14aaaf15181731bb79f9f7f925560482a60c5 (patch) | |
tree | 42be922edcd5ee07eebf45a8a26ff73a81be8edb /src/network | |
parent | f2634c3a48ead400867566a20c2e03b2ec901983 (diff) | |
download | qtbase-0dd14aaaf15181731bb79f9f7f925560482a60c5.tar.gz |
Define friend functions of QSslEllipticCurve outside of class
Define both qHash() and operator==() outside of the class, like
it is already done for operator!=(). Defining it inside the
class limits it to argument-dependent lookup, which in turn
means that the lookup rules for operator!= and operator==
were slightly different (e.g. if one would compare variables
of a type that is implicitly convertible to QSslEllipticCurve).
As a side-effect, this also fixes a qdoc warning.
Change-Id: I40ab2f8cd2b6b5f42481dd254229a88b678f3f15
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/ssl/qsslellipticcurve.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/network/ssl/qsslellipticcurve.h b/src/network/ssl/qsslellipticcurve.h index 63ab2f3c37..a991881b93 100644 --- a/src/network/ssl/qsslellipticcurve.h +++ b/src/network/ssl/qsslellipticcurve.h @@ -68,10 +68,8 @@ public: private: int id; - friend Q_DECL_CONSTEXPR bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) Q_DECL_NOTHROW - { return lhs.id == rhs.id; } - friend Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed) Q_DECL_NOTHROW - { return qHash(curve.id, seed); } + friend Q_DECL_CONSTEXPR bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) Q_DECL_NOTHROW; + friend Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed) Q_DECL_NOTHROW; friend class QSslSocketPrivate; friend class QSslSocketBackendPrivate; @@ -79,6 +77,12 @@ private: Q_DECLARE_TYPEINFO(QSslEllipticCurve, Q_PRIMITIVE_TYPE); +Q_DECL_CONSTEXPR inline uint qHash(QSslEllipticCurve curve, uint seed) Q_DECL_NOTHROW +{ return qHash(curve.id, seed); } + +Q_DECL_CONSTEXPR inline bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) Q_DECL_NOTHROW +{ return lhs.id == rhs.id; } + Q_DECL_CONSTEXPR inline bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs) Q_DECL_NOTHROW { return !operator==(lhs, rhs); } |