Property change problem
Jarrett Billingsley
kb3ctd2 at yahoo.com
Mon Jul 21 10:26:04 PDT 2008
"Zarathustra" <adam.chrapkowski at gmail.com> wrote in message
news:g62dv7$gao$1 at digitalmars.com...
> l_bar.foo.u.a = 5; // no effect
I really wish the compiler could catch stuff like this. It has no effect
because it's doing something like this:
auto temp = l_bar.foo.u;
temp.a = 5;
And then throwing away 'temp'. That is, it's not modifying l_bar.foo.u,
it's modifying a temporary copy of it.
It would work if u() returned an SSome* (that is, "return &this.m_u;"), but
I don't know if that's acceptable for you.
More information about the Digitalmars-d-learn
mailing list