summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qvariant.h2
-rw-r--r--src/corelib/tools/qbytearray.h1
-rw-r--r--src/corelib/tools/qhash.h1
-rw-r--r--src/corelib/tools/qlinkedlist.h1
-rw-r--r--src/corelib/tools/qlist.h3
-rw-r--r--src/corelib/tools/qstring.h1
-rw-r--r--src/corelib/tools/qvector.h1
7 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index 67cec6875a..8ba27d2354 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -251,6 +251,8 @@ class Q_CORE_EXPORT QVariant
QVariant& operator=(const QVariant &other);
#ifdef Q_COMPILER_RVALUE_REFS
+ inline QVariant(QVariant &&other) : d(other.d)
+ { other.d = Private(); }
inline QVariant &operator=(QVariant &&other)
{ qSwap(d, other.d); return *this; }
#endif
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 79a7377c40..1e2a93d9f0 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -201,6 +201,7 @@ public:
QByteArray &operator=(const QByteArray &);
QByteArray &operator=(const char *str);
#ifdef Q_COMPILER_RVALUE_REFS
+ inline QByteArray(QByteArray && other) : d(other.d) { other.d = Data::sharedNull(); }
inline QByteArray &operator=(QByteArray &&other)
{ qSwap(d, other.d); return *this; }
#endif
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index d196e6e376..3936e36efb 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -287,6 +287,7 @@ public:
QHash<Key, T> &operator=(const QHash<Key, T> &other);
#ifdef Q_COMPILER_RVALUE_REFS
+ inline QHash(QHash<Key, T> &&other) : d(other.d) { other.d = const_cast<QHashData *>(&QHashData::shared_null); }
inline QHash<Key, T> &operator=(QHash<Key, T> &&other)
{ qSwap(d, other.d); return *this; }
#endif
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index a8a97b308a..1caf21f456 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -83,6 +83,7 @@ public:
~QLinkedList();
QLinkedList<T> &operator=(const QLinkedList<T> &);
#ifdef Q_COMPILER_RVALUE_REFS
+ inline QLinkedList(QLinkedList<T> &&other) : d(other.d) { other.d = const_cast<QLinkedListData *>(&QLinkedListData::shared_null); }
inline QLinkedList<T> &operator=(QLinkedList<T> &&other)
{ qSwap(d, other.d); return *this; }
#endif
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 0d5b109f2f..ad94781b6f 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -115,7 +115,8 @@ public:
~QList();
QList<T> &operator=(const QList<T> &l);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QList &operator=(QList &&other)
+ inline QList(QList<T> &&other) : d(other.d) { other.d = const_cast<QListData::Data *>(&QListData::shared_null); }
+ inline QList &operator=(QList<T> &&other)
{ qSwap(d, other.d); return *this; }
#endif
inline void swap(QList<T> &other) { qSwap(d, other.d); }
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 61b7264296..7b6d7842cc 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -198,6 +198,7 @@ public:
QString &operator=(const QString &);
inline QString &operator=(const QLatin1String &);
#ifdef Q_COMPILER_RVALUE_REFS
+ inline QString(QString && other) : d(other.d) { other.d = Data::sharedNull(); }
inline QString &operator=(QString &&other)
{ qSwap(d, other.d); return *this; }
#endif
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index b36b832c26..60cf12e60d 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -115,6 +115,7 @@ public:
inline ~QVector() { if (!d->ref.deref()) free(d); }
QVector<T> &operator=(const QVector<T> &v);
#ifdef Q_COMPILER_RVALUE_REFS
+ inline QVector(QVector<T> &&other) : d(other.d) { other.d = Data::sharedNull(); }
inline QVector<T> operator=(QVector<T> &&other)
{ qSwap(d, other.d); return *this; }
#endif