Introduce StringBuilder utility around raw_string_ostream
chandlerc at google.com
Thu Jun 12 04:33:12 PDT 2014
On Thu, Jun 12, 2014 at 5:25 AM, Alp Toker <alp at nuanti.com> wrote:
> Replaces the pattern:
> std::string buf;
> raw_string_ostream os(buf);
So this pattern should be:
> StringBuilder os;
> use (os.str());
Which is now almost identical to this. What's the advantage?
The reason I like the current form is that it makes it obvious and easy to
re-use storage where that is reasonable, and it makes variations with
SmallString more obviously the same pattern with a different storage.
We could even add a 'make_raw_ostream' or some such so that the pattern can
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits