qarraydatapointer: use use std::exchange more
to simplify code Change-Id: I7fc6dd92922eb30a16260544223c1dbfc3162188 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
f331171dd7
commit
d0b90663a4
@ -75,11 +75,10 @@ public:
|
|||||||
|
|
||||||
Q_NODISCARD_CTOR
|
Q_NODISCARD_CTOR
|
||||||
QArrayDataPointer(QArrayDataPointer &&other) noexcept
|
QArrayDataPointer(QArrayDataPointer &&other) noexcept
|
||||||
: d(other.d), ptr(other.ptr), size(other.size)
|
: d(std::exchange(other.d, nullptr)),
|
||||||
|
ptr(std::exchange(other.ptr, nullptr)),
|
||||||
|
size(std::exchange(other.size, 0))
|
||||||
{
|
{
|
||||||
other.d = nullptr;
|
|
||||||
other.ptr = nullptr;
|
|
||||||
other.size = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QArrayDataPointer)
|
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QArrayDataPointer)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user