[Issue 10876] foreach and remove over associative array causes invalid data to appear

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 23 14:31:40 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10876



--- Comment #5 from hsteoh at quickfur.ath.cx 2013-08-23 14:31:39 PDT ---
Some relevant references:

http://stackoverflow.com/questions/3346696/python-why-is-it-not-safe-to-modify-sequence-being-iterated-on

http://stackoverflow.com/questions/13981886/simultaneously-iterating-over-and-modifying-an-unordered-set

The bottomline is that modifying the container while you're iterating over it
is a bad idea (unless the container was specifically designed to support it).
It almost always doesn't do what you think it should do.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list