DIP23 draft: Fixing properties redux

Timon Gehr timon.gehr at gmx.ch
Sun Feb 3 07:21:09 PST 2013


On 02/03/2013 04:04 PM, Steven Schveighoffer wrote:
> On Sun, 03 Feb 2013 08:04:10 -0500, Timon Gehr <timon.gehr at gmx.ch> wrote:
>
>> T delegate() f = &a.prop -> auto f = ()=>a.prop;
>> T delegate(T) f = &a.prop -> auto f = (T x)=>a.prop=x;
>
> I don't like this solution.  You are creating a dummy delegate function,
> and moving the stack frame into the heap, just so you can get a delegate
> to an already existing function.
>
> -Steve

The spec could be updated to allow/mandate eta-reduction where applicable.


More information about the Digitalmars-d mailing list