Ref local variables?

Steven Schveighoffer schveiguy at
Mon Jan 9 07:13:34 PST 2012

On Mon, 09 Jan 2012 09:27:06 -0500, bearophile <bearophileHUGS at>  

> Steven Schveighoffer:
>> With new => syntax (in git head), this would probably be:
>> @property ref tile => map[y*w+x];
> That's not currently supported:

The given function is not a method, but it is an inner-class function.

But you are right, it's a named function not a lambda.  I'm not too  
concerned about whether this version works or not, the other version is  
reasonably short.

I wonder if this would work, but it wouldn't be inlined like my original  

auto tile = @property ref () => map[y*w+x];


More information about the Digitalmars-d-learn mailing list