From d62491f595d59a63d9c493a223573e9af2306214 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 10 Aug 2009 15:11:39 +0200 Subject: add operator! to QScopedPointer --- src/corelib/tools/qscopedpointer.cpp | 8 ++++++++ src/corelib/tools/qscopedpointer.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp index 06f9e6f..5b8991e 100644 --- a/src/corelib/tools/qscopedpointer.cpp +++ b/src/corelib/tools/qscopedpointer.cpp @@ -207,4 +207,12 @@ QT_BEGIN_NAMESPACE Callers of this function take ownership of the pointer. */ +/*! \fn bool QScopedPointer::operator!() const + + Returns \c true if the pointer referenced by this object is \c null, otherwise + returns \c false. + + \sa isNull() +*/ + QT_END_NAMESPACE diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h index 923ae1b..769ad10 100644 --- a/src/corelib/tools/qscopedpointer.h +++ b/src/corelib/tools/qscopedpointer.h @@ -123,6 +123,11 @@ public: return d != other.d; } + inline bool operator!() const + { + return !d; + } + #if defined(Q_CC_NOKIAX86) || defined(Q_QDOC) inline operator bool() const { -- cgit v0.12