[D2] How to not full closure?
Jarrett Billingsley
kb3ctd2 at yahoo.com
Mon Jul 14 10:16:27 PDT 2008
"downs" <default_357-line at yahoo.de> wrote in message
news:g5fs5j$p0d$1 at digitalmars.com...
>>
>> Wouldn't it suffice to overload the new keyword?
>>
>> heap:
>>
>> delegate t = new { return 3; }
>>
>> stack:
>>
>> delegate t = { return 3; }
>>
>> That way it could work with delegate literals too:
>>
>> int b = 3;
>> foo(new { return b; });
>>
>> -Mike
>>
>>
>
> For what it's worth, I like that solution a lot.
Seconded.
More information about the Digitalmars-d
mailing list