-dip1000 and non-scope variables

Jacob Carlborg doob at me.com
Thu Feb 18 11:30:03 UTC 2021


On Thursday, 18 February 2021 at 10:05:52 UTC, RazvanN wrote:

> Normally, in @safe code you are not allowed to take the address 
> of a local or a parameter, however, it seems that with -dip1000 
> that is allowed and the compiler tries to infer `scope`.

Isn't that the whole point or at least a big part of DIP100 (or 
was that @live)? It can track the pointers and knows that it's 
safe if the pointer doesn't live longer than the local variable.

--
/Jacob Carlborg


More information about the Digitalmars-d mailing list