diff options
Diffstat (limited to 'src/corelib/tools/qscopedpointer.h')
-rw-r--r-- | src/corelib/tools/qscopedpointer.h | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h index 923ae1b..344964b 100644 --- a/src/corelib/tools/qscopedpointer.h +++ b/src/corelib/tools/qscopedpointer.h @@ -113,16 +113,21 @@ public: return d; } - inline bool operator==(const QScopedPointer<T> &other) const + inline bool operator==(const QScopedPointer<T, Cleanup> &other) const { return d == other.d; } - inline bool operator!=(const QScopedPointer<T> &other) const + inline bool operator!=(const QScopedPointer<T, Cleanup> &other) const { return d != other.d; } + inline bool operator!() const + { + return !d; + } + #if defined(Q_CC_NOKIAX86) || defined(Q_QDOC) inline operator bool() const { @@ -189,6 +194,16 @@ public: return this->d[i]; } + inline bool operator==(const QScopedArrayPointer<T, Cleanup> &other) const + { + return this->d == other.d; + } + + inline bool operator!=(const QScopedArrayPointer<T, Cleanup> &other) const + { + return this->d != other.d; + } + private: Q_DISABLE_COPY(QScopedArrayPointer) }; @@ -209,6 +224,16 @@ public: return this->d; } + inline bool operator==(const QCustomScopedPointer<T, Cleanup> &other) const + { + return this->d == other.d; + } + + inline bool operator!=(const QCustomScopedPointer<T, Cleanup> &other) const + { + return this->d != other.d; + } + private: Q_DISABLE_COPY(QCustomScopedPointer) }; @@ -253,6 +278,16 @@ public: QScopedPointerSharedDeleter<T>::cleanup(oldD); } + inline bool operator==(const QScopedSharedPointer<T> &other) const + { + return this->d == other.d; + } + + inline bool operator!=(const QScopedSharedPointer<T> &other) const + { + return this->d != other.d; + } + private: Q_DISABLE_COPY(QScopedSharedPointer) }; |