<div class="gmail_quote">Denis:<br>>BTW, save() is already implemented and used throughout the Phobos under
a different name - opSlice<br> (i.e. auto copy = range[]). It's a bikeshed
discussion, but why save() and not opSlice(), or even clone()?<br><br>2009/11/11 Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div>It can't be clone() because it doesn't clone. For example say you have a T[] - one would expect clone() actually copies the content. But using opSlice is a good idea.<br></div></blockquote><div><br>
I don't get it. Shouldn't save() copy the content?<br><br>Do you mean we could use opSlice() (the parameterless version) as a save function and write "auto r2 = r1[];"?<br>But, again maybe I don't get something: for dyn. arrays (aka the range archetype) opSlice is not a save, it's just an alias. So using opSlice doesn't work for remembering positions with arrays.<br>
<br> Philippe<br><br></div></div>