FeedbackThread: DIP 1038-- at nodiscard--Community Review Round 1

Paul Backus snarwin at gmail.com
Sat Dec 12 15:16:08 UTC 2020


On Wednesday, 9 December 2020 at 20:10:14 UTC, Denis Feklushkin 
wrote:
> On Wednesday, 9 December 2020 at 14:30:13 UTC, Andrej Mitrovic 
> wrote:
>> 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.
>
> Do not forgot about templates with auto-inferred return types. 
> It can be void or not, it depend on template arguments.

I have trouble imagining why you would want to mark such a 
function as @nodiscard in the first place. If you can come up 
with a plausible example, please reply in the discussion thread.


More information about the Digitalmars-d mailing list