From b18c3ecdbd396e8c516a7f5fb424a3a5144eb860 Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Fri, 22 Nov 2024 17:21:26 +0100 Subject: [PATCH] [docs] Add description of other C++20 features to the overview Task-number: QTBUG-128837 Pick-to: 6.8 Change-Id: I07731cd75c97c16eb008a76727b2ae831c029284 Reviewed-by: Jaishree Vyas (cherry picked from commit 82f6938d8ad66468576c52da7d85a2288f78af7e) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/doc/src/cpp20-overview.qdoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/corelib/doc/src/cpp20-overview.qdoc b/src/corelib/doc/src/cpp20-overview.qdoc index 5e485feaf6a..58d79fe0a66 100644 --- a/src/corelib/doc/src/cpp20-overview.qdoc +++ b/src/corelib/doc/src/cpp20-overview.qdoc @@ -56,4 +56,18 @@ implicitly converted into each other. However, there are some differences between the classes. See the corresponding section in the \l {span-STL} {QSpan class documentation} for more details. + + \section1 Additional important features + + Qt has also adopted a few more features from C++20, such as: + + \list + \li \l Q_CONSTINIT macro that expands to the C++20 \c {constinit} + keyword, or to compiler-specific attributes if they are available + \li \l Q_NODISCARD_CTOR macro that expands to the \c {[[nodiscard]]} + attribute if the compiler supports \c {[[nodiscard]]} on + constructors + \li \l Q_NODISCARD_X and \l Q_NODISCARD_CTOR_X macros for + \c {[[nodiscard("reason")]]} + \endlist */