Andrei Alexandrescu wrote:
Bill Baxter wrote:
On Wed, Jul 29, 2009 at 11:08 AM, Andrei
Alexandrescu<[email protected]> 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

Reply via email to