http://wiki.dlang.org/DIP25

Andrej Mitrovic via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 31 04:42:49 PST 2014


On 12/31/14, Andrei Alexandrescu via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On 12/30/14 7:32 PM, Manu via Digitalmars-d wrote:
>> void mayEscape(ref int x); // <-- may escape this ref arg
>>
>> void t()
>> {
>>    int onStack = 1;
>>    mayEscape(onStack); // <- perfectly legal, and equally unsafe
>> }
>
> DIP25 puts this code in illegality. I don't think the proposal has been
> explicit about that, will fix. Thanks! -- Andrei

Wait, what? Passing stack variables by ref will be disallowed?


More information about the Digitalmars-d mailing list