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/qbitarray.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/qbitarray.h')
-rw-r--r-- | src/corelib/tools/qbitarray.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/tools/qbitarray.h b/src/corelib/tools/qbitarray.h index 1103712627..eaf9b2ff25 100644 --- a/src/corelib/tools/qbitarray.h +++ b/src/corelib/tools/qbitarray.h @@ -61,6 +61,7 @@ public: QBitArray(const QBitArray &other) : d(other.d) {} inline QBitArray &operator=(const QBitArray &other) { d = other.d; return *this; } #ifdef Q_COMPILER_RVALUE_REFS + inline QBitArray(QBitArray &&other) : d(std::move(other.d)) {} inline QBitArray &operator=(QBitArray &&other) { qSwap(d, other.d); return *this; } #endif |