<div class="gmail_quote">Denis:<br>&gt;BTW, save() is already implemented and used throughout the Phobos under
a different name - opSlice<br> (i.e. auto copy = range[]). It&#39;s a bikeshed
discussion, but why save() and not opSlice(), or even clone()?<br><br>2009/11/11 Andrei Alexandrescu <span dir="ltr">&lt;<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>&gt;</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&#39;t be clone() because it doesn&#39;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&#39;t get it. Shouldn&#39;t save() copy the content?<br><br>Do you mean we could use opSlice() (the parameterless version) as a save function and write &quot;auto r2 = r1[];&quot;?<br>But, again maybe I don&#39;t get something: for dyn. arrays (aka the range archetype) opSlice is not a save, it&#39;s just an alias. So using opSlice doesn&#39;t work for remembering positions with arrays.<br>
<br>   Philippe<br><br></div></div>