FeedbackThread: DIP 1038-- at nodiscard--Community Review Round 1
Andrej Mitrovic
andrej.mitrovich at gmail.com
Wed Dec 9 14:30:13 UTC 2020
On Wednesday, 9 December 2020 at 10:11:52 UTC, Mike Parker wrote:
> This is the feedback thread for the first round of Community
> Review of DIP 1038, "@nodiscard".
From the DIP:
> By contrast, @nodiscard can be used with any function because
> all functions have a return type.
Just a small implementation note: I think @nodiscard should not
apply to void functions. In other words, if I have:
-----
@nodiscard:
int foo();
void bar();
-----
then calling `bar();` should just work, we shouldn't need to
write `cast(void)bar()`.
At least I can't think of use-cases for it having an effect on
void functions.
More information about the Digitalmars-d
mailing list