DIP23 draft: Fixing properties redux

TommiT tommitissari at hotmail.com
Sun Feb 3 07:35:29 PST 2013


On Sunday, 3 February 2013 at 08:16:08 UTC, Andrei Alexandrescu 
wrote:
> Walter and I have had a discussion on how to finalize 
> properties.
>
> http://wiki.dlang.org/DIP23
> [..]

What happens here?

struct S
{
     int _n;

     @property ref int prop()
     {
         return _n;
     }
}

@property void prop(ref S s, int n)
{
     s._n = 42;
}

void main()
{
     S s;
     s.prop = 10;
}


More information about the Digitalmars-d mailing list