DIP 1038--"@mustUse" (formerly "@noDiscard")--Accepted

forkit forkit at gmail.com
Wed Feb 9 20:42:43 UTC 2022


On Wednesday, 9 February 2022 at 17:54:17 UTC, rikki cattermole 
wrote:
>
> On 10/02/2022 5:21 AM, Paul Backus wrote:
>> - C (gcc/clang): __attribute__((warn_unused_result))
>
> C23 will also have [[nodiscard]]
>
> Not only will it have that on functions, but also support a 
> string too.
>
> Unfortunately its looking like we have chosen to diverge from 
> C, and therefore won't be completely C compatible soon.
>
> Will be exciting as to what kind of bugs crop up because of 
> this!

Exactly. So now C++ and C will have nodiscard, and when those 
developers come over to D (the developers most targetted by D 
btw), someone will have to explain why D decided on a different 
color for the bikeshed.



More information about the Digitalmars-d-announce mailing list