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 | 821b9938579959d258121c4afb801d392b2ed536 (patch) | |
tree | c887614aa35b294a0b9ccc57d9c1e02cba33db96 | |
parent | abb629c02356182dde8d001f32733deb540f54a2 (diff) |
[docs] Adjust qExchange() docs for the present, where C++17 is required [2/2]: 6.3+
In C++17, std::exchange() is unconditionally available, so focus
attention on the missing constexpr and noexcept.
Manual conflict resolutions:
- docs moved from qglobal.cpp to qttypetraits.qdoc in 6.5
Change-Id: I5eb466b784bd741a7313a1554d8b7b67711d2cbc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9c1a00271bccd8cefa1a7e568e21debc429ad73a)
-rw-r--r-- | src/corelib/global/qglobal.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 2ebdcdefb1..e9a75ba9e8 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3811,9 +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 before C++20. + only in that it is \c constexpr already before C++20 and noexcept already before C++23. - We strongly advise to use std::exchange() when you don't need the C++20 variant. + We strongly advise to use std::exchange() when you don't need the C++20 or C++23 variants. Here is how to use qExchange() to implement move constructors: \code |