http://d.puremagic.com/issues/show_bug.cgi?id=9437
--- Comment #3 from [email protected] 2013-02-01 06:31:01 PST --- (In reply to comment #2) > Ok, but silently doing this that is really bad and a is really a thing in D > where could create many bug But silently doing what? If the range provides random access, then which behavior would you expect? //---- int arr[] = [1, 2, 3] foreach ( a ; arr) writeln(arr.front); //So this print 1, 2, 3? assert(arr.length == 3); //But this should pass? //---- The expected behavior of foreach is *only* to iterate on each element of the range, but it is also expected to *not* modify the range. It is modifying the range that would provide surprising results. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
