Ranges and indexes with foreach

kenji hara k.hara.pg at gmail.com
Mon Jan 23 17:50:55 PST 2012


Precise documentation is not yet written. The original issue is
http://d.puremagic.com/issues/show_bug.cgi?id=6366

Kenji Hara

2012/1/24 Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org>:
> 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