Ranges, constantly frustrating

thedeemon dlang at thedeemon.com
Tue Feb 11 18:05:14 PST 2014


On Tuesday, 11 February 2014 at 19:48:41 UTC, Jesse Phillips 
wrote:

> In case the other replies weren't clear enough. A range does 
> not have an index.
>
> What do you expect 'i' to be?

In case of foreach(i, x; range) I would expect it to be iteration 
number of this particular foreach. I miss it sometimes, have to 
create another variable and increment it. I didn't know about 
automatic tuple expansion though, that looks better.


More information about the Digitalmars-d-learn mailing list