On 7/25/14, 6:39 PM, Jonathan M Davis wrote:
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

No, the OP said the meaning was `myrange.dropExactly(i).front`, which is not a random access.

Sometimes you *do* want the n-th element of a range even if the range is not a random access.

Reply via email to