http://wiki.dlang.org/DIP25
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Wed Dec 31 12:54:36 PST 2014
Andrej Mitrovic via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> 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?
Only to functions that return ref.
More information about the Digitalmars-d
mailing list