<div dir="ltr">Just for clarification, I wanted '<a href="http://myrange.at">myrange.at</a>(i)' to be the same as <span style="font-family:arial,sans-serif;font-size:13px"> `myrange.dropExactly(i).front` (so I don't assume it's a random access range).</span><div>
<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">>> myrange.dropExactly(i).front makes it much more obvious what you're doing and that it's inefficient. It might be necessary in some cases, but we don't want to give the impression that it's cheap, which at() would do.</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">I think it's already clear that it's potentially O(n) [n=i] cost as we're not using myrange[i]. But fine, call it atWalk/walkAt/whatever. Point is it's a common enough operation.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jul 26, 2014 at 11:15 AM, monarch_dodra via Digitalmars-d-learn <span dir="ltr"><<a href="mailto:digitalmars-d-learn@puremagic.com" target="_blank">digitalmars-d-learn@puremagic.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Saturday, 26 July 2014 at 00:28:32 UTC, Ary Borenszweig wrote:<br>
</div><div class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
No, the OP said the meaning was `myrange.dropExactly(i).front`<u></u>, which is not a random access.<br>
<br>
Sometimes you *do* want the n-th element of a range even if the range is not a random access.<br>
</blockquote>
<br></div>
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").<br>
<br>
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?<br>
<br>
</blockquote></div><br></div>