digitalmars.D - AA reference semantics
- H. S. Teoh (14/14) Mar 13 2012 Is this a bug?
- Daniel Murphy (7/12) Mar 13 2012 Nope.
- H. S. Teoh (8/25) Mar 13 2012 Ahh, I see.
Is this a bug? int[string] aa, bb; bb = aa; aa["abc"] = 123; assert(bb["abc"] == 123); // assertion fails The following works: int[string] aa, bb; aa["def"] = 456; bb = aa; aa["abc"] = 123; assert(bb["abc"] == 123); // OK T -- Don't drink and derive. Alcohol and algebra don't mix.
Mar 13 2012
"H. S. Teoh" <hsteoh quickfur.ath.cx> wrote in message news:mailman.652.1331699976.4860.digitalmars-d puremagic.com...Is this a bug?Nope.int[string] aa, bb;aa == bb == nullbb = aa;sameaa["abc"] = 123;A new AA is created.assert(bb["abc"] == 123); // assertion failsB is still null
Mar 13 2012
On Wed, Mar 14, 2012 at 04:20:32PM +1100, Daniel Murphy wrote:"H. S. Teoh" <hsteoh quickfur.ath.cx> wrote in message news:mailman.652.1331699976.4860.digitalmars-d puremagic.com...OK good. That means I don't have to fix my AA implementation. :-PIs this a bug?Nope.Ahh, I see.int[string] aa, bb;aa == bb == nullOK, makes sense.bb = aa;sameaa["abc"] = 123;A new AA is created.Righto. T -- Be in denial for long enough, and one day you'll deny yourself of things you wish you hadn't.assert(bb["abc"] == 123); // assertion failsB is still null
Mar 13 2012