diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-07 08:52:26 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-12-01 07:59:16 +0100 |
commit | abb629c02356182dde8d001f32733deb540f54a2 (patch) | |
tree | b3a166a044076fe8a76f59e2e3feaab7df659952 | |
parent | a1e84f4bf7c53585ce9f8e3ae369475c35de7ae3 (diff) | |
download | qtbase-abb629c02356182dde8d001f32733deb540f54a2.tar.gz |
[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.
Manual conflict resolutions:
- docs moved from qglobal.cpp to qttypetraits.qdoc in 6.5
Change-Id: Ia09bf6da7bd62e5a41083cfc5253e30a0298099f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8cb4ada2a4aaa80cae411da6df9d07e8e7150a51)
-rw-r--r-- | src/corelib/global/qglobal.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 7b5b8bc67d..2ebdcdefb1 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3811,8 +3811,9 @@ bool qunsetenv(const char *varName) 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 |