summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydatapointer.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-07-08 14:42:35 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-07-10 02:16:09 +0200
commit8a13aa0e02c4709677efd07df00ec24c42c7b424 (patch)
treec496b117cd06f2f3664ee389592de790e2c26f09 /src/corelib/tools/qarraydatapointer.h
parent6758f73bb7f85898b2f2a24149bdacf898601e25 (diff)
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>
Diffstat (limited to 'src/corelib/tools/qarraydatapointer.h')
-rw-r--r--src/corelib/tools/qarraydatapointer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index a7e8429469..bb24f3e6f2 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -103,7 +103,8 @@ public:
QArrayDataPointer &operator=(QArrayDataPointer &&other) noexcept
{
- this->swap(other);
+ QArrayDataPointer moved(std::move(other));
+ swap(moved);
return *this;
}