From 52812e9a2b578d3c25f85612a6fdcffbdefd84e1 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 6 Jul 2015 16:57:31 +0200 Subject: QMulti(Map|Hash): add move ctor from Q(Map|Hash) There was a copy ctor, a move ctor was missing. Change-Id: If09a4d4c74682169759eff43b298f6c77702c169 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/tools/qhash.h | 3 +++ src/corelib/tools/qmap.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 8d65a018ae..8e71925fd9 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -948,6 +948,9 @@ public: // compiler-generated destructor is fine! QMultiHash(const QHash &other) : QHash(other) {} +#ifdef Q_COMPILER_RVALUE_REFS + QMultiHash(QHash &&other) Q_DECL_NOTHROW : QHash(std::move(other)) {} +#endif void swap(QMultiHash &other) { QHash::swap(other); } // prevent QMultiHash<->QHash swaps inline typename QHash::iterator replace(const Key &key, const T &value) diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index b7bd268bda..df2e5f1caf 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -1177,6 +1177,9 @@ public: } #endif QMultiMap(const QMap &other) : QMap(other) {} +#ifdef Q_COMPILER_RVALUE_REFS + QMultiMap(QMap &&other) Q_DECL_NOTHROW : QMap(std::move(other)) {} +#endif inline void swap(QMultiMap &other) { QMap::swap(other); } inline typename QMap::iterator replace(const Key &key, const T &value) -- cgit v1.2.3