Why is indexed foreach restricted to build in array ?

matovitch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 11 03:50:16 PDT 2015


Hello,

The question is in the title. It should be possible for a finite 
random access ranges to perform an indexed foreach no ? I mean 
like :

foreach(size_t i = 0, auto ref x; R)
{
     /*...*/
}

Why are other foreach statements overloadable but this one ?

Thanks in advance.


More information about the Digitalmars-d-learn mailing list