Properties: a.b.c = 3

KennyTM~ kennytm at gmail.com
Wed Jul 29 13:18:24 PDT 2009


Andrei Alexandrescu wrote:
> Bill Baxter wrote:
>> On Wed, Jul 29, 2009 at 11:08 AM, Andrei
>> Alexandrescu<SeeWebsiteForEmail at erdani.org> wrote:
>>>> I don't believe the problem needs to be solved.
>>> To me it looks like an essential problem.
>>
>> It's a problem, but not a problem of properties.  Just a problem of
>> temporary return values in general.
> 
> Yes. It is particularly exacerbated by properties

and opDot().

struct S {
   int s;
}

class X {
   S opDot() { S temp; temp.s = 6; return temp; }
}

X z = new X;
assert(z.s == 6);
z.s = 3;
assert(z.s == 6);

So, can we stop considering this general problem as a barrier for 
properties? Or just remove opDot() altogether.

> because of the 
> syntactical deception.
> 
> Andrei



More information about the Digitalmars-d mailing list