From 6b14ea1ba4153aa06de73fea7f2f21788d740553 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 6 Jul 2021 17:00:39 +0200 Subject: [PATCH] qSwap: make it constexpr C++20 gave us constexpr std::swap, but it makes no sense for qSwap not to be constexpr anyways. [ChangeLog][QtCore][QtGlobal] qSwap is now constexpr. Change-Id: I13f3cbf2870adf5770c62dc00e15004978fc85d9 Pick-to: 6.2 Reviewed-by: Marc Mutz --- src/corelib/global/qglobal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 8bf0e8c6bc..ff0da86f65 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1113,7 +1113,7 @@ namespace SwapExceptionTester { // insulate users from the "using std::swap" bel // Documented in ../tools/qalgorithm.qdoc template -inline void qSwap(T &value1, T &value2) +constexpr void qSwap(T &value1, T &value2) noexcept(noexcept(QtPrivate::SwapExceptionTester::checkSwap(value1))) { using std::swap;