QArrayDataPointer: use move and swap in move assignment

Not plain swap; QADP does not hold just memory but arbitrary
state (depending on T).

Change-Id: I3560577e4109607a51b2c72b67e22e38813977b3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2020-07-08 14:42:35 +02:00
parent 6758f73bb7
commit 8a13aa0e02

View File

@ -103,7 +103,8 @@ public:
QArrayDataPointer &operator=(QArrayDataPointer &&other) noexcept
{
this->swap(other);
QArrayDataPointer moved(std::move(other));
swap(moved);
return *this;
}