-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
See microsoft/STL@7643c27 via PR nonstd-lite/expected-lite#74.
Plan:
Readme, section Synopsis, Configuration:
#### Disable \[\[nodiscard\]\]
-D<b>xxx\_CONFIG\_NO\_NODISCARD</b>=0
Define this to 1 if you want to compile without \[\[nodiscard\]\]. Note that the default of marking `class xxx` with \[\[nodiscard\]\] is not part of the C++23 standard. The rationale to use \[\[nodiscard\]\] is that unnoticed discarded expected error values may break the error handling flow.Code:
// Control marking class XXX with [[nodiscard]]]:
#if !defined(xxx_CONFIG_NO_NODISCARD)
# define xxx_CONFIG_NO_NODISCARD 0
#else
# define xxx_CONFIG_NO_NODISCARD 1
#endif// Presence of C++17 language features:
...
#define xxx_HAVE_NODISCARD xxx_CPP17_000// C++ feature usage:
...
#if xxx_HAVE_NODISCARD && !xxx_CONFIG_NO_NODISCARD
# define xxx_NODISCARD [[nodiscard]]
#else
# define xxx_NODISCARD /*[[nodiscard]]*/
#endiftemplate<...>
class xxx_NODISCARD XXXReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels