foreach range with index

bachmeier via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 14 15:48:49 PDT 2017


On Wednesday, 14 June 2017 at 22:02:30 UTC, Ali Çehreli wrote:

> Then, perhaps we're arguing in favor of
>
> * writing .enumerate even for slices (implying that automatic 
> indexing for them has been a historical artifact and code that 
> wants to be portable should always write .enumerate)
>
> * making sure that enumerate() on arrays don't bring extra cost
>
> Ali

I like this proposal.

Is there a reason you don't introduce .enumerate in the section 
of your book "The counter is automatic only for arrays"?


More information about the Digitalmars-d mailing list