summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2022-09-26 17:38:14 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2022-09-28 17:39:21 +0000
commita0dfa8c4d29a005009d04dcb52452efb9d74e26e (patch)
tree7b400e7a8fc2dd2db99d780e94ff4bf1b63ce375 /src/corelib/plugin
parentd06d22fbc0ef1d070408fe7e1f6a5c33e6f8c4e2 (diff)
Replace qExchange calls with std::exchange
qExchange is one of the few remaining functionalities that have not been moved out of qglobal. Given that std::exchange exists in the standard, we can simply move to it everywhere... ...if it weren't for the fact that std::exchange is only constexpr in C++20, and only has its noexceptness specified in (most likely) C++23. Still, we want to move to the existing std functionality where possible, to allow the removal of qglobal includes in lieu of something more fine-grained in the future. So leave any constexpr calls[1] alone for now (and observe that none of our current usages cares about the conditional noexceptness), but replace everything else. [1] QScopedValueRollback' ctor and QExplicitlySharedDataPointerV2::take Task-number: QTBUG-99313 Change-Id: I599cb9846cf319c7ffd3457130938347a75aad25 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 4ee87d0dab..06015127d6 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -319,7 +319,7 @@ void QFactoryLoader::setExtraSearchPath(const QString &path)
return; // nothing to do
QMutexLocker locker(&qt_factoryloader_global->mutex);
- QString oldPath = qExchange(d->extraSearchPath, path);
+ QString oldPath = std::exchange(d->extraSearchPath, path);
if (oldPath.isEmpty()) {
// easy case, just update this directory
d->updateSinglePath(d->extraSearchPath);