summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qfutureinterface.cpp
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2020-07-24 12:30:00 +0200
committerAndrei Golubev <andrei.golubev@qt.io>2020-08-03 16:47:31 +0200
commitb3c1093751072110d34b9746d419e8070c80fc3f (patch)
tree6efa2be54684b03d57f3f299247f0a14f144d82e /src/corelib/thread/qfutureinterface.cpp
parentfddb0c895f9a12d61bbc4cf33149a8d1a93eaf19 (diff)
Introduce swap functions for QPromise/QFutureInterface
Made QPromise::swap public, added free standing swap() for QFutureInterface and QPromise. Updated QPromise special member functions. Extended tests Task-number: QTBUG-84977 Change-Id: I5daf6876df306d082441dbcdf5ae4dee3bfc0ead Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/thread/qfutureinterface.cpp')
-rw-r--r--src/corelib/thread/qfutureinterface.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/thread/qfutureinterface.cpp b/src/corelib/thread/qfutureinterface.cpp
index 1785815cf3..a625e05aac 100644
--- a/src/corelib/thread/qfutureinterface.cpp
+++ b/src/corelib/thread/qfutureinterface.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -545,6 +545,11 @@ QFutureInterfaceBase &QFutureInterfaceBase::operator=(const QFutureInterfaceBase
return *this;
}
+void QFutureInterfaceBase::swap(QFutureInterfaceBase &other) noexcept
+{
+ qSwap(d, other.d);
+}
+
bool QFutureInterfaceBase::refT() const
{
return d->refCount.refT();