summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlist.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qlist.h')
-rw-r--r--src/corelib/tools/qlist.h3
1 files changed, 2 insertions, 1 deletions
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); }