<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 19, 2015 at 9:56 AM, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 19 May 2015 at 17:49, David Chisnall <<a href="mailto:David.Chisnall@cl.cam.ac.uk">David.Chisnall@cl.cam.ac.uk</a>> wrote:<br>
> Going from std::string to StringRef involves going from an explicit copy to something with nontrivial ownership semantics. The converse transform would be trivial (it’s always safe to use a std::string instead of a StringRef, you’re just going to end up with lots of redundant copies), but going in this direction requires reasoning about the surrounding code.<br>
<br>
</span>The idea is to go from std::string to StringRef/Twine, not the other<br>
way around, so the problems are usually non-trivial.<br>
<br></blockquote><div><br></div><div>A related problem is foo(...,T* Elems, int NElem,...) -> foo(...,ArrayRef<T> Arr,...)</div><div><br></div><div>I think we've been pretty good about this lately, but that transformation is highly mechanical and there are probably a fair number of cases remaining.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
cheers,<br>
--renato<br>
<div class=""><div class="h5"><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div></div>