D-Programming-Language/phobos — pull request #1713 by monarchdodra (2013-11-23 17:49:25+00:00)
Title: Make std.container.Array assert.

I've been wanting to do this for a while, but kept getting side-tracked by the amount of things to do in `std.container.Array`.

I made this pull "minimal":
It makes `std.container.Array` (and it's `Range`) assert on any out of bounds conditions. Furhermore, I made sure the `Error` thrown is actually a `RangeError`. `Range` only makes minial validation about its own boundaries, before delegating to `Array` (avoids code duplication/double validation (except for "move" functions, which don't exist in `Array`)).

Last but not least, I corrected a little issue in `Range`, where doing "0 .. 0" operations on a non-initialized Array threw an error, when there is actually no reason to.