Built-in range type

Lionello Lunesu lio at lunesu.remove.com
Wed Apr 28 01:09:49 PDT 2010


Slices are one of D's greatest assets, and now in D2 we have the new
foreach range statement: foreach(i; 0..22) { ... }

Wouldn't it be nice to introduce a built-in for these int..int ranges?

auto range = 0..22;
auto slice = array[range];
foreach(i; range) {...}

L.



More information about the Digitalmars-d mailing list