summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qpointer.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-08-17 20:23:22 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-06-17 07:09:57 +0000
commit2d9700c041b7d19f8204d96b2dc8b37859fbf4f5 (patch)
treebcdf2d21611deeee694721a938ad4342b9d7d874 /src/corelib/kernel/qpointer.h
parent9f1646b0d9b1ffb61ffa69b4027d7c45766b0e98 (diff)
QPointer: add member-swap
Change-Id: I5704badc86f98e549c586656ec8df3915632ce15 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/kernel/qpointer.h')
-rw-r--r--src/corelib/kernel/qpointer.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/kernel/qpointer.h b/src/corelib/kernel/qpointer.h
index 07649ce0b2..a3e922ccc9 100644
--- a/src/corelib/kernel/qpointer.h
+++ b/src/corelib/kernel/qpointer.h
@@ -66,6 +66,8 @@ public:
// compiler-generated copy/move ctor/assignment operators are fine!
inline ~QPointer() { }
+ inline void swap(QPointer &other) { wp.swap(other.wp); }
+
inline QPointer<T> &operator=(T* p)
{ wp.assign(static_cast<QObjectType*>(p)); return *this; }