diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-08-15 12:39:41 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-05 13:29:43 +0200 |
commit | e3e42322c077b15970e15362420199a7be5ccf3d (patch) | |
tree | d329c0460b366795b64b4e6f5099bb0e102f861f /src/corelib/tools/qset.h | |
parent | f4714459a864bbdeb476f94228600ea7b24aadb2 (diff) |
Add some easy move constructors
These are easy, since they can be inline. Most types that would
benefit from move constructors can't have inline move constructors
because these types use smart pointers whose destructor is invoked
in the type's move constructor. Implementing move constructors
out-of-line would break binary compatibility between C++98 and C++11
builds of Qt and its users, so that is not attempted here.
Change-Id: I7f14437c2069cce54c498c7858f4e9060ff05e7b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/corelib/tools/qset.h')
-rw-r--r-- | src/corelib/tools/qset.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h index d5c3637293..1390c67c80 100644 --- a/src/corelib/tools/qset.h +++ b/src/corelib/tools/qset.h @@ -70,6 +70,7 @@ public: inline QSet<T> &operator=(const QSet<T> &other) { q_hash = other.q_hash; return *this; } #ifdef Q_COMPILER_RVALUE_REFS + inline QSet(QSet &&other) : q_hash(qMove(other.q_hash)) {} inline QSet<T> &operator=(QSet<T> &&other) { qSwap(q_hash, other.q_hash); return *this; } #endif |