summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsharedpointer_impl.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-02-22 23:47:46 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-28 21:27:41 +0100
commitad5f6d4326069b29021364ca0c81d09a4acb4631 (patch)
tree27b99cb9e2d2bc39fd527b879d8f3a7e23cbcdcf /src/corelib/tools/qsharedpointer_impl.h
parent9788c0f47cfae17a39137dec47aa0b9f3f9bedad (diff)
QSharedPointer: implement move ctor
Change-Id: I46974aa1d056be797db959b547a1516157b598ca Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qsharedpointer_impl.h')
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 1423449a69..e7b23157db 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -327,6 +327,12 @@ public:
return *this;
}
#ifdef Q_COMPILER_RVALUE_REFS
+ inline QSharedPointer(QSharedPointer &&other)
+ : value(other.value), d(other.d)
+ {
+ other.d = 0;
+ other.value = 0;
+ }
inline QSharedPointer<T> &operator=(QSharedPointer<T> &&other)
{
swap(other);