On Sunday, 3 February 2013 at 15:04:15 UTC, Steven Schveighoffer wrote:
On Sun, 03 Feb 2013 08:04:10 -0500, Timon Gehr <[email protected]> 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

Unless you escape the delegate, it should allocate on the heap. And any inlining compiler should remove the delegate completely anyway.

Reply via email to