QCborValue: streamline some code with qExchange

Change-Id: I79b68173a236ff1f28504a11ff182bdf48b2df0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Giuseppe D'Angelo 2020-10-11 17:45:48 +02:00
parent 3e08154582
commit f8076d6a5b
1 changed files with 1 additions and 3 deletions

View File

@ -179,10 +179,8 @@ public:
QCborValue(const QCborValue &other);
QCborValue(QCborValue &&other) noexcept
: n(other.n), container(other.container), t(other.t)
: n(other.n), container(qExchange(other.container, nullptr)), t(qExchange(other.t, Undefined))
{
other.t = Undefined;
other.container = nullptr;
}
QCborValue &operator=(const QCborValue &other);
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QCborValue)