<div dir="ltr">I'd like to clarify some conflicts I've encountered.<div><br></div><div style>TDPL talks about ranges, it mentions random access ranges requiring these functions:</div><div style><br></div><div style>
  T at(int i)</div><div style>  Range slice(int x, int y)</div><div style><br></div><div style>But most code I encounter rather implements:</div><div style><br></div><div style>  T opIndex(size_t i)</div><div style><div>  Range opSlice(size_t x, size_t y)</div>
<div><br></div><div style>Which is it? Is there a distinction? One approach is deprecated?</div><div style><br></div><div style><br></div><div style>Also, forward ranges require:</div><div style><br></div><div style>  Range save()</div>
<div style><br></div><div style>But there is also this function:</div><div style><br></div><div style>  Range opSlice()</div><div style><br></div><div style>With no args, handles the syntax 'range[]'. save() and opSlice() with no args would appear to be identical.</div>
<div style>Why have both? Which will be used in which cases?</div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 24 March 2013 13:03, Manu <span dir="ltr"><<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm trying to write some ranges with strictly controlled sets of features, but the docs on ranges are either very poor, or illusive (I can't find any).<div>
<br></div><div>Suggest: Add a category under Language -> Language Reference about ranges, and all the stuff that defines their use/limitations. With some examples.</div>
<div><br></div><div>I'm just copying from the std libs and hope I catch all the details.</div></div>
</blockquote></div><br></div>