summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-02-28 21:30:12 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-17 20:52:46 +0100
commitb4a427bac6f16d4e81e6a9cdb7c78bc8ae7f42b4 (patch)
tree9b40b9fde4f3ccc149e0905e2bd93a03f14910fd
parent9b58f95c63dbd45b31cf9b5a82582807fd5aecd2 (diff)
Doc: document QSharedPointer::swap() method
The function is already present for quite some time, but was never documented, so declare it as \since 5.3. Add swap() function to qsharedpointer.h so it's visible to QDoc, too. Change-Id: I8eba420878a096392fd181a180d5751101d37a50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/tools/qsharedpointer.cpp8
-rw-r--r--src/corelib/tools/qsharedpointer.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 77409f5c71..a610fc46e5 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -478,6 +478,14 @@
*/
/*!
+ \fn void QSharedPointer::swap(QSharedPointer<T> &other);
+ \since 5.3
+
+ Swaps this shared pointer instance with \a other. This function is
+ very fast and never fails.
+*/
+
+/*!
\fn T *QSharedPointer::data() const
Returns the value of the pointer referenced by this object.
diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h
index 7d1f00814d..34b4bfbb12 100644
--- a/src/corelib/tools/qsharedpointer.h
+++ b/src/corelib/tools/qsharedpointer.h
@@ -79,6 +79,8 @@ public:
QSharedPointer<T> &operator=(const QSharedPointer<T> &other);
QSharedPointer<T> &operator=(const QWeakPointer<T> &other);
+ void swap(QSharedPointer<T> &other);
+
QWeakPointer<T> toWeakRef() const;
void clear();