[Issue 16149] foreach_reverse can't handle index variable of type int

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jun 10 08:47:11 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16149

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com
                 OS|Linux                       |All

--- Comment #3 from Steven Schveighoffer <schveiguy at yahoo.com> ---
I think it's a decent enhancement request. Most arrays are not going to exceed
int.max, and if they do, well, you wrote the stupid code!

For example, foreach(ubyte i, v; iota(500).array) is going to compile, and get
into an infinite loop. I think you should be able to make the same dumb mistake
with foreach_reverse :)

--


More information about the Digitalmars-d-bugs mailing list