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>
This commit is contained in:
Giuseppe D'Angelo 2021-07-06 17:00:39 +02:00 committed by Marc Mutz
parent 0e6b31019f
commit 6b14ea1ba4

View File

@ -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;