[libcxx-commits] [PATCH] D129964: [libc++][format] Improve format buffer.

Victor Zverovich via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jul 30 07:35:00 PDT 2022


vitaut added a comment.

> Next I want to look at the std::back_inserter<std::string>.

That and `std::back_inserter<std::vector<char>>` are exactly the cases I had in mind in "exploring direct writes to contiguous containers", sorry for not being clear. I'm glad that you have it planned.



================
Comment at: libcxx/include/__format/formatter_output.h:96
+_LIBCPP_HIDE_FROM_ABI auto
+__copy(basic_string_view<_CharT> __str, output_iterator<const _OutCharT&> auto __out_it) -> decltype(__out_it) {
+  if constexpr (_VSTD::same_as<decltype(__out_it), _VSTD::back_insert_iterator<__format::__output_buffer<_OutCharT>>>) {
----------------
Mordante wrote:
> vitaut wrote:
> > Why const?
> You mean in `output_iterator<const _OutCharT&>`? 
> I used that due to http://eel.is/c++draft/format#functions-13
> `Constraints: Out satisfies output_­iterator<const charT&>.` Should that wording be different?
Ah, right. I always forget what T means in `output_iterator` =).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129964



More information about the libcxx-commits mailing list