http://d.puremagic.com/issues/show_bug.cgi?id=4475
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #9 from [email protected] 2013-08-15 10:06:29 PDT --- (In reply to comment #8) [...] > > aa["a"] = new C(); > > auto c = "a" in aa; > > aa["b"] = new C(); > > // Using c here is undefined as an element was added to aa > > This can't happen if "in" returns a bool. Actually, that is not undefined. AA's are designed such that inserting new elements does not invalidate pointers to existing elements. In D, because we have a GC, even if you *delete* elements from AA's, pointers returned by 'in' continue to be valid. This holds even in the event of a rehash, because the pointer points to data in a Slot, and add/remove/rehash only shuffle pointers in the Slot, it doesn't move the Slot around in memory. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
