[libcxx-commits] [libcxx] [libc++] Eliminate extra allocations from `std::move(oss).str()` (PR #67294)

Amirreza Ashouri via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 2 08:14:35 PDT 2023


AMP999 wrote:

@philnik @ldionne 
Re "there is no requirement in the standard," I think the use of the term "move constructed" in https://eel.is/c++draft/stringbuf#members-10.sentence-1 is that requirement. The original paper P0408 also contains this test case https://github.com/PeterSommerlad/SC22WG21_Papers/blob/master/workspace/Test_basic_stringbuf_efficient/src/Testp0407-p0408-efficientStringstreams.cpp#L105-L112 which won't succeed unless we transfer ownership here. Transfer-of-ownership is clearly P0408's intent.

https://github.com/llvm/llvm-project/pull/67294


More information about the libcxx-commits mailing list