diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-27 23:53:31 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-29 08:51:26 +0100 |
commit | 2222e695fcb547ed6c08f290b3b34bf36013eaad (patch) | |
tree | a2f86798bdb9ec04eb2e2ea9acd58182a1bfdd40 /src | |
parent | 5866b82e240915b9b8d2be7394af560877111ee3 (diff) |
QMetaMethod: Make comparison operators hidden friends
Reduce ADL noise.
Change-Id: Ic747c2d76b7ce66b222e08eeaf6f1d193ba99f81
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qmetaobject.h | 11 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 3ac7e478e2..6b6e2b0912 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1640,18 +1640,16 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase * invoked), otherwise returns \c false. */ -/*! \fn bool operator==(const QMetaMethod &m1, const QMetaMethod &m2) +/*! \fn bool QMetaMethod::operator==(const QMetaMethod &m1, const QMetaMethod &m2) \since 5.0 - \relates QMetaMethod \overload Returns \c true if method \a m1 is equal to method \a m2, otherwise returns \c false. */ -/*! \fn bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2) +/*! \fn bool QMetaMethod::operator!=(const QMetaMethod &m1, const QMetaMethod &m2) \since 5.0 - \relates QMetaMethod \overload Returns \c true if method \a m1 is not equal to method \a m2, diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h index 629d6c1891..ca30815ec1 100644 --- a/src/corelib/kernel/qmetaobject.h +++ b/src/corelib/kernel/qmetaobject.h @@ -208,16 +208,13 @@ private: friend struct QMetaObject; friend struct QMetaObjectPrivate; friend class QObject; - friend bool operator==(const QMetaMethod &m1, const QMetaMethod &m2); - friend bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2); + friend bool operator==(const QMetaMethod &m1, const QMetaMethod &m2) noexcept + { return m1.data == m2.data; } + friend bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2) noexcept + { return !(m1 == m2); } }; Q_DECLARE_TYPEINFO(QMetaMethod, Q_MOVABLE_TYPE); -inline bool operator==(const QMetaMethod &m1, const QMetaMethod &m2) -{ return m1.data == m2.data; } -inline bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2) -{ return !(m1 == m2); } - class Q_CORE_EXPORT QMetaEnum { public: |