Introduce StringBuilder utility around raw_string_ostream
Rafael EspĂndola
rafael.espindola at gmail.com
Thu Jun 12 07:03:17 PDT 2014
On 12 June 2014 09:54, Chandler Carruth <chandlerc at google.com> wrote:
> How about an even simpler approach.
>
> Put a std::string inside raw_string_ostream, and a default constructor which
> binds the reference to its internal std::string. I'm moderately confident
> that our optimizers will remove the "dead" std::string that is left in the
> class by users that want to leverage external storage.
>
> This has the advantage of not introducing any new types or patterns, merely
> removing the requirement to pass in a std::string to provide storage by
> using internal storage.
>
> That's getting far enough down in the simplicity (for folks learning about
> the APIs) to make me quite happy.
I like it!
Thanks,
Rafael
More information about the llvm-commits
mailing list