myrange.at(i) for myrange.dropExactly(i).front

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 25 14:39:40 PDT 2014


On Friday, 25 July 2014 at 21:33:23 UTC, Timothee Cour via 
Digitalmars-d-learn wrote:
> Is there a function for doing this?
> myrange.at(i)
> (with meaning of myrange.dropExactly(i).front)
> it's a common enough operation (analog to myrange[i]; the 
> naming is from
> C++'s std::vector<T>::at)

That would require a random access range, in which case you can 
just index directly. For a non-random access range, which you're 
doing would be the most direct way of doing it.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list