summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-07-06 17:00:39 +0200
committerMarc Mutz <marc.mutz@kdab.com>2021-07-07 01:13:53 +0000
commit6b14ea1ba4153aa06de73fea7f2f21788d740553 (patch)
tree9d45c7756b1c7c1c7a05ed406c86c006efcb3fbd /src/corelib/global/qglobal.h
parent0e6b31019f01c72ea3af3de31095f8269c7d7f30 (diff)
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 <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/global/qglobal.h')
-rw-r--r--src/corelib/global/qglobal.h2
1 files changed, 1 insertions, 1 deletions
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 <typename T>
-inline void qSwap(T &value1, T &value2)
+constexpr void qSwap(T &value1, T &value2)
noexcept(noexcept(QtPrivate::SwapExceptionTester::checkSwap(value1)))
{
using std::swap;