<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-06-02 14:51 GMT+02:00 Steven Schveighoffer via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">I have always treated ranges with this expectation:<br>
<br></blockquote><div><br>I think the case is pretty clear here, and I'm in agreement with you.<br><br>I just want to add a note on the following point:</div><div>2016-06-02 14:51 GMT+02:00 Steven Schveighoffer via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
The counter-argument seems to be that if you cache the front element, then then making a copy of the range via take can repeat the cached element[4]. I find this argument severely lacking -- non-forward ranges are not meant to be copied and expected to operate properly, it's why we require calling save.<br></blockquote><div><br>The compiler is blatantly guilty of doing so: <a href="https://issues.dlang.org/show_bug.cgi?id=15413">https://issues.dlang.org/show_bug.cgi?id=15413</a> </div></div></div></div>