AA reference semantics
H. S. Teoh
hsteoh at quickfur.ath.cx
Tue Mar 13 22:46:26 PDT 2012
On Wed, Mar 14, 2012 at 04:20:32PM +1100, Daniel Murphy wrote:
> "H. S. Teoh" <hsteoh at quickfur.ath.cx> wrote in message
> news:mailman.652.1331699976.4860.digitalmars-d at puremagic.com...
> > Is this a bug?
> >
>
> Nope.
OK good. That means I don't have to fix my AA implementation. :-P
> > int[string] aa, bb;
> aa == bb == null
Ahh, I see.
> > bb = aa;
> same
>
> > aa["abc"] = 123;
> A new AA is created.
OK, makes sense.
> > assert(bb["abc"] == 123); // assertion fails
> >
>
> B is still null
Righto.
T
--
Be in denial for long enough, and one day you'll deny yourself of things you wish you hadn't.
More information about the Digitalmars-d
mailing list