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

monarch_dodra via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 26 11:15:43 PDT 2014


On Saturday, 26 July 2014 at 00:28:32 UTC, Ary Borenszweig wrote:
> 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.

What he did also say is he wanted the equivalent of C++'s "at", 
which is the equivalent of "checked random-access" (or "checked 
dictionary access").

So the actual requirements aren't very clear. In terms of "C++ 
at" equivalent, I don't think we have anything equivalent to 
offer. That said, I've never seen anyone use "at" in C++ ever. 
I'd assume it's more of a java/C# thing to do checked accesses?



More information about the Digitalmars-d-learn mailing list