logan-5 added a comment.

To be clear, it sounds like we should //either// add `.take()` for moving the 
string out of `raw_string_ostream`'s string reference, //or// make 
`raw_string_ostream` not need to be flushed (after which there won't be as 
clear a use for `.take()`, since you can just use the underlying string 
directly).

I vote for the second option, making `raw_string_ostream` not need to be 
flushed, since it allows for simpler code at the call site (`return Str;`), 
permits NRVO at the call site, and avoids some possibly weird questions 
`.take()` would bring with it (like whether it would ever be surprising that it 
moves out of a //reference// that someone else might also have).

If that's the direction that sounds best, I can submit an updated patch 
sometime tomorrow.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115374/new/

https://reviews.llvm.org/D115374

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to