[cfe-dev] Interest in StringRef'ize APIs Open Project

David Chisnall David.Chisnall at cl.cam.ac.uk
Tue May 19 10:01:16 PDT 2015


On 19 May 2015, at 09:56, Renato Golin <renato.golin at linaro.org> wrote:
> 
> On 19 May 2015 at 17:49, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:
>> 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.
> 
> The idea is to go from std::string to StringRef/Twine, not the other
> way around, so the problems are usually non-trivial.

I think that’s what I said?

David





More information about the cfe-dev mailing list