From 8cb4ada2a4aaa80cae411da6df9d07e8e7150a51 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 7 Oct 2022 08:52:26 +0200 Subject: [PATCH] [docs] Adjust qExchange() docs for the present, where C++17 is required [1/2]: 6.2 In C++17, std::exchange() is unconditionally available, so focus attention on the missing constexpr. Pick-to: 6.4 6.3 6.2 Change-Id: Ia09bf6da7bd62e5a41083cfc5253e30a0298099f Reviewed-by: Ivan Solovev Reviewed-by: Thiago Macieira --- src/corelib/global/qttypetraits.qdoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qttypetraits.qdoc b/src/corelib/global/qttypetraits.qdoc index 6bb1ceba2c..ab25e30cbf 100644 --- a/src/corelib/global/qttypetraits.qdoc +++ b/src/corelib/global/qttypetraits.qdoc @@ -64,8 +64,9 @@ Replaces the value of \a obj with \a newValue and returns the old value of \a obj. This is Qt's implementation of std::exchange(). It differs from std::exchange() - only in that it is \c constexpr already in C++14, and available on all supported - compilers. + only in that it is \c constexpr already before C++20. + + We strongly advise to use std::exchange() when you don't need the C++20 variant. Here is how to use qExchange() to implement move constructors: \code