diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 07:14:45 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-07 18:11:36 +0200 |
commit | dd562b36720b78caffe5c53bda4ed8449bf6fe06 (patch) | |
tree | d5a515a58da4c4065f583360a41a04cd82d21276 /src/corelib/tools/qshareddata.h | |
parent | e08fa9cc01f11ce61258e0d9a138118bff3453c8 (diff) |
Replace qExchange with std::exchange
None of these users require C++20 constexpr or C++23 noexcept, the
only remaining difference between std::exchange and qExchange.
This leaves a single qExchange() user, in QScopedValueRollback, that
requires the constexpr version, only available from C++20, and thus
remains unported.
Task-number: QTBUG-99313
Change-Id: Iea46f6ed61d6bd8a5b2fd9d9ec4d70c980b443a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qshareddata.h')
-rw-r--r-- | src/corelib/tools/qshareddata.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h index 813e9d6c7a..826152b63a 100644 --- a/src/corelib/tools/qshareddata.h +++ b/src/corelib/tools/qshareddata.h @@ -49,7 +49,7 @@ public: const T *data() const noexcept { return d; } const T *get() const noexcept { return d; } const T *constData() const noexcept { return d; } - T *take() noexcept { return qExchange(d, nullptr); } + T *take() noexcept { return std::exchange(d, nullptr); } QSharedDataPointer() noexcept : d(nullptr) { } ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; } |