[libcxx-commits] [PATCH] D128139: [libc++][format] Improve integral formatters.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 28 08:55:05 PDT 2022


ldionne accepted this revision.
ldionne added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libcxx/include/__format/formatter_integer.h:50
+  _LIBCPP_HIDE_FROM_ABI auto format(_Tp __value, auto& __ctx) const -> decltype(__ctx.out()) {
+    return __format(__value, __ctx, __parser_.__get_parsed_std_specifications(__ctx));
+  }
----------------
Would it make sense to inline `__format` into this function instead?


================
Comment at: libcxx/include/__format/formatter_integral.h:311
+  // The function @ref __insert_sign will a '-' when the value was negative.
+  auto __r        = __to_unsigned_like(__value);
+  bool __negative = __value < 0;
----------------
ADL


================
Comment at: libcxx/include/__format/parser_std_format_spec.h:1856
+  if (__parser.__sign_ != __sign::__default)
+    __throw_format_error("A sign field isn't allowed in this format-spec");
+
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128139



More information about the libcxx-commits mailing list