diff options
author | Matthias Rauter <[email protected]> | 2025-05-22 13:11:46 +0200 |
---|---|---|
committer | Volker Hilsheimer <[email protected]> | 2025-05-24 08:49:39 +0000 |
commit | d462031902ebf03d37223f31bea0b82352f2ffde (patch) | |
tree | bcaddce2c9a3459a32ae2da1485d652509fc9919 | |
parent | cf4015bcd8718b6811a97269b161605e0c1280ff (diff) |
Change-Id: Ie317db2aeed6c55423f678d0385e0c8f7a9c7b2b
Reviewed-by: Marc Mutz <[email protected]>
-rw-r--r-- | quip-0019-nodiscard-policy.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/quip-0019-nodiscard-policy.rst b/quip-0019-nodiscard-policy.rst index 8bec419..54fa5ba 100644 --- a/quip-0019-nodiscard-policy.rst +++ b/quip-0019-nodiscard-policy.rst @@ -14,7 +14,7 @@ This QUIP aims to document how we use the ``[[nodiscard]]`` attribute in Qt. Motivation ---------- -The ``[nodiscard]]`` attribute can be applied to functions to cause a +The ``[[nodiscard]]`` attribute can be applied to functions to cause a warning if the function's return value is ignored (discarded). This can be used to alert the user of the function to non-sensical (``list.empty();``) or dangerous code (ignoring error codes). @@ -35,7 +35,7 @@ Version History equivalents, if any. This macro can only be used on (non-constructor) functions. -- Since Qt 6.0, we can use ``[nodiscard]`` unconditionally on +- Since Qt 6.0, we can use ``[[nodiscard]]`` unconditionally on (non-constructor) functions and at class level (non-exported classes only). The use of ``Q_REQUIRED_RESULT`` is discouraged in Qt 6. |