struct T
{
    int x;
    @property ref X(){ return x; }
    @property X(int v)
    {
        x = v;
    }
}

T t;
t.X += 10;

The setter 'x = v' are not executed because i´m returning the reference of x. And without the 'ref' the compiler complains because 'x' is not a lvalue.

Any solution to make it work like native arr.length+=10 works?

( I Thought on returning a struct with "+=" operator but it is a strange solution )

Reply via email to