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>
This commit is contained in:
parent
c0f7ecab20
commit
725c37ffe0
@ -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); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user