Bug 20165 – Add standard @nodiscard attribute for functions
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-08-24T23:24:28Z
Last change time
2020-08-24T21:03:01Z
Assigned to
No Owner
Creator
Manu
Comments
Comment #0 by turkeyman — 2019-08-24T23:24:28Z
Can we please have a standard @nodiscard attribute that all implementations agree on?
Do want compile errors when functions discard the result form @nodiscard functions.
It can help reduce bugs in some cases, and it's a very nice self-documenting feature which makes the API intent a little clearer.
Comment #1 by snarwin+bugzilla — 2020-08-24T21:03:01Z
*** This issue has been marked as a duplicate of issue 5464 ***