[libcxx-commits] [PATCH] D125704: [libc++] Make to_chars base 10 header only.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 31 09:21:18 PDT 2022


ldionne accepted this revision.
ldionne added a comment.
This revision is now accepted and ready to land.

LGTM!



================
Comment at: libcxx/include/__charconv/to_chars_base_10.h:36
+_LIBCPP_HIDE_FROM_ABI char* __append2(char* __buffer, _Tp __value) noexcept {
+  memcpy(__buffer, &__digits_base_10[(__value)*2], 2);
+  return __buffer + 2;
----------------
We could be more ADL-safe here and elsewhere in this file. I guess it's mostly a matter of style and consistency because the types we use these functions with are not going to do ADL hijacking.


================
Comment at: libcxx/include/charconv:160
     {
-        return __u64toa(__v, __p);
+        return __base_10_u64(__v, __p);
     }
----------------
Pre-existing issue but we might as well fix it -- this should be ADL safe. Same elsewhere.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125704



More information about the libcxx-commits mailing list