D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20165 - Add standard @nodiscard attribute for functions
Summary: Add standard @nodiscard attribute for functions
Status: RESOLVED DUPLICATE of issue 5464
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-24 23:24 UTC by Manu
Modified: 2020-08-24 21:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Manu 2019-08-24 23:24:28 UTC
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 Paul Backus 2020-08-24 21:03:01 UTC

*** This issue has been marked as a duplicate of issue 5464 ***