Weird issue with std.range.iota.length

tsbockman via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 12 02:37:31 PST 2016


On Friday, 12 February 2016 at 10:34:32 UTC, tsbockman wrote:
> Bounds checking. If iota's length is not expressible as a 
> `size_t`, convert it to one *safely* using `std.conv.to()`.

Just to clarify - the bit about `std.conv.to()` is just an 
example.

A better solution in this specific case would be to check once, 
while the iota() range is being constructed, whether its length 
is expressible as a `size_t` or not.


More information about the Digitalmars-d mailing list