diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-02-16 10:51:32 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-03-09 10:34:08 +0100 |
commit | 0fa0d01c3673c7f68b5820869c444421c0591ca1 (patch) | |
tree | deb104c7189a769201bc643159a3280f768603ed /src | |
parent | a5a6b657a799cbed4567f60342714df52f9c8891 (diff) |
QT_NO_QEXCHANGE: add docs
Pick-to: 6.7 6.6
Change-Id: Ibb54de391a580814c9392b262966e2e2947364d9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qttypetraits.qdoc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/global/qttypetraits.qdoc b/src/corelib/global/qttypetraits.qdoc index 1d5b336021..b308a9b55b 100644 --- a/src/corelib/global/qttypetraits.qdoc +++ b/src/corelib/global/qttypetraits.qdoc @@ -79,6 +79,7 @@ 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 or C++23 variants. + You can make qExchange() unavailable by defining the \l{QT_NO_QEXCHANGE} macro. Here is how to use qExchange() to implement move constructors: \code @@ -118,3 +119,13 @@ long as the loop runs, saving the declaration of a temporary variable. Be aware, though, that qExchange() returns a non-const object, so Qt containers may detach. */ + +/*! + \macro QT_NO_QEXCHANGE + \since 6.6 + + Defining this macro removes the availability of the qExchange() + function. + + \sa qExchange +*/ |