[libcxx-commits] [PATCH] D110498: [libc++][format][4/6] Improve formatted_size.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 14 08:10:49 PST 2022


Mordante marked 2 inline comments as done.
Mordante added inline comments.


================
Comment at: libcxx/include/format:579-599
+template <class... _Args>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT size_t
+formatted_size(string_view __fmt, const _Args&... __args) {
+  __format::__formatted_size_buffer<char> __buffer;
+  _VSTD::__vformat_to(__buffer.make_output_iterator(), __fmt,
+                      basic_format_args{_VSTD::make_format_args(__args...)});
+
----------------
Mordante wrote:
> vitaut wrote:
> > I suggest adding `__vformatted_size` and force-inlining `formatted_size` to reduce template bloat.
> > 
> > Also why move this block? 
> It's moved so `format_to_n` can use `formatted_size`.
Since `formatted_size` no longer depends on `format_to_n` I moved it to its original location.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110498



More information about the libcxx-commits mailing list