[libcxx-commits] [PATCH] D103425: [libc++][format] Adds string formatter.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 18 07:05:22 PDT 2021


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


================
Comment at: libcxx/include/__format/formatter.h:124-126
+ * @note The type of the input @a __first, @a __last can differ from the type
+ * of @a __fill. Integer output uses @c std::to_chars for its conversion. This
+ * function returns a buffer with @c char elements.
----------------
vitaut wrote:
> Did you mean the type of values in [`__first`, `__last`) being different from the type of `__fill`? `__first` and `__last` themselves are pointers, not code units.
> 
> Also the comment says "This function returns a buffer with @c char elements." while in fact it returns an output iterator.
I updated the wording.


================
Comment at: libcxx/include/__format/formatter_string.h:101
+    formatter<const _CharT*, _CharT>
+    : public __format_spec::__formatter_string<_CharT> {
+  using _Base = __format_spec::__formatter_string<_CharT>;
----------------
vitaut wrote:
> nit: public is redundant here and elsewhere since this is a struct.
true, I'm just used to writing this explicitly. AFAIK that's also the code convention in libc++. So for now I keep it unless @ldionne objects.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103425



More information about the libcxx-commits mailing list