diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-06-06 01:31:07 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-06-06 13:29:49 +0200 |
commit | 725c37ffe0cc46e4140f5dab46df3cb14337f454 (patch) | |
tree | df05c03f19d9b8044d8235c0f7bc7e1e2b58329b /src/corelib/kernel/qvariant.h | |
parent | c0f7ecab2084e3e720a012d1254f52bfbbe1446e (diff) |
QVariant: move and swap in the move assignment operator
And not pure swap. As per policy, QVariant must leave the rhs empty.
Change-Id: I2d5e0f584c4d4fffd05a0a5bfae27ddcb72430e9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.h')
-rw-r--r-- | src/corelib/kernel/qvariant.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index d8ac0324ac..2cc09ba616 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -271,7 +271,7 @@ class Q_CORE_EXPORT QVariant inline QVariant(QVariant &&other) noexcept : d(other.d) { other.d = Private(); } inline QVariant &operator=(QVariant &&other) noexcept - { qSwap(d, other.d); return *this; } + { QVariant moved(std::move(other)); swap(moved); return *this; } inline void swap(QVariant &other) noexcept { qSwap(d, other.d); } |