DIP1028 - Rationale for accepting as is
Walter Bright
newshound2 at digitalmars.com
Sat May 23 00:05:38 UTC 2020
On 5/22/2020 10:54 AM, Atila Neves wrote:
>> BTW, you should fix that invalid attribute, freeing a pointer is never @safe
>> unless you can guarantee nobody else has a copy of that pointer (and
>> considering it's passed by value, the CALLER still has that pointer!)
>
> You're completely right.
@live is intended to fix that!
To get ahead of the curve, annotate pointer parameters with `scope` if you don't
intend to transfer ownership to the callee. Better yet, use `ref` instead of
pointer parameters where possible.
More information about the Digitalmars-d-announce
mailing list