Ranges and indexes with foreach

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jan 23 17:22:03 PST 2012


On 1/23/12 6:40 PM, kenji hara wrote:
> Today, foreach can expand the front tuple automatically.
>
> foreach (i, e; zip(sequence!"n", range))
> {
>      // i = 0, 1, 2, ...
>      // e = elements of range
> }
>
> So extra unpacking syntax is not need.
>
> Kenji Hara

That's awesome! Walter mentioned you made that addition. Is there some 
precise documentation to it?

Thanks,

Andrei


More information about the Digitalmars-d mailing list