diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2016-05-03 23:19:49 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2016-06-08 09:09:47 +0000 |
commit | 982ef5b494319bfaaa585cf0620a821dc3b7c642 (patch) | |
tree | 25d87e709f3e12bf722f88716ad1ae18a976b783 /src/corelib/tools/qsharedpointer.h | |
parent | 997572d85918b1a660414b43a91c619cf294bd39 (diff) |
QSharedPointer/QWeakPointer/QScopedPointer: add comparison against nullptr
Some constructors were added, but the comparison operators were missing.
The STL has them, so we ought have them too.
Change-Id: I030c14a3b355988f509716b4b1b1a835b3ab9481
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/tools/qsharedpointer.h')
-rw-r--r-- | src/corelib/tools/qsharedpointer.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h index 6b38f0e80c..3b86eb238b 100644 --- a/src/corelib/tools/qsharedpointer.h +++ b/src/corelib/tools/qsharedpointer.h @@ -149,6 +149,14 @@ template<class T, class X> bool operator==(const QWeakPointer<T> &ptr1, const QS template<class T, class X> bool operator!=(const QWeakPointer<T> &ptr1, const QSharedPointer<X> &ptr2); template<class T, class X> bool operator==(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2); template<class T, class X> bool operator!=(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2); +template<class T> bool operator==(const QSharedPointer<T> &lhs, std::nullptr_t); +template<class T> bool operator!=(const QSharedPointer<T> &lhs, std::nullptr_t); +template<class T> bool operator==(std::nullptr_t, const QSharedPointer<T> &rhs); +template<class T> bool operator!=(std::nullptr_t, const QSharedPointer<T> &rhs); +template<class T> bool operator==(const QWeakPointer<T> &lhs, std::nullptr_t); +template<class T> bool operator!=(const QWeakPointer<T> &lhs, std::nullptr_t); +template<class T> bool operator==(std::nullptr_t, const QWeakPointer<T> &rhs); +template<class T> bool operator!=(std::nullptr_t, const QWeakPointer<T> &rhs); template <class X, class T> QSharedPointer<X> qSharedPointerCast(const QSharedPointer<T> &other); template <class X, class T> QSharedPointer<X> qSharedPointerCast(const QWeakPointer<T> &other); |