================ @@ -452,9 +452,9 @@ format_to(_OutIt __out_it, wformat_string<_Args...> __fmt, _Args&&... __args) { // fires too eagerly, see http://llvm.org/PR61563. template <class = void> [[nodiscard]] _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI string vformat(string_view __fmt, format_args __args) { - string __res; - std::vformat_to(std::back_inserter(__res), __fmt, __args); - return __res; + __format::__allocating_buffer<char> __buffer; ---------------- ldionne wrote:
It would actually be really nice if `vformat_to(std::back_inserter(string), ...)` were just as performant as using the allocating buffer. It seems to me that if using the `__allocating_buffer` directly is faster, there may be a problem with next patch's `buffer_selector` which would basically be picking a less efficient approach for the case of `std::back_inserter<std::string>`. https://github.com/llvm/llvm-project/pull/101817 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits