www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Second parameter with ranges

reply dsimcha <dsimcha yahoo.com> writes:
How do you do something like the following with ranges?

auto foo = someRange([1U, 2, 3, 4, 5]);
foreach(index, elem; foo) {
   writeln(index, "  ", elem);
}

Has this been addressed yet?
Apr 18 2009
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
dsimcha wrote:
 How do you do something like the following with ranges?
 
 auto foo = someRange([1U, 2, 3, 4, 5]);
 foreach(index, elem; foo) {
    writeln(index, "  ", elem);
 }
 
 Has this been addressed yet?

No :o(. Andrei
Apr 18 2009