diff options
Diffstat (limited to 'src/corelib/tools/qscopedpointer.h')
-rw-r--r-- | src/corelib/tools/qscopedpointer.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h index 18fbe2c808..92d7df6e5d 100644 --- a/src/corelib/tools/qscopedpointer.h +++ b/src/corelib/tools/qscopedpointer.h @@ -188,6 +188,30 @@ inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, const QScopedPoint } template <class T, class Cleanup> +inline bool operator==(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) Q_DECL_NOTHROW +{ + return lhs.isNull(); +} + +template <class T, class Cleanup> +inline bool operator==(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW +{ + return rhs.isNull(); +} + +template <class T, class Cleanup> +inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) Q_DECL_NOTHROW +{ + return !lhs.isNull(); +} + +template <class T, class Cleanup> +inline bool operator!=(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW +{ + return !rhs.isNull(); +} + +template <class T, class Cleanup> inline void swap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2) Q_DECL_NOTHROW { p1.swap(p2); } |