[libcxx-commits] [PATCH] D70631: Microsoft's floating-point to_chars powered by Ryu and Ryu Printf

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 7 19:00:53 PDT 2021


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/include/charconv:1672
+_LIBCPP_AVAILABILITY_TO_CHARS _LIBCPP_HIDE_FROM_ABI
+inline to_chars_result to_chars(char* const _First, char* const _Last, const float _Value) noexcept /* strengthened */ {
+    return _Floating_to_chars<_Floating_to_chars_overload::_Plain>(_First, _Last, _Value, chars_format{}, 0);
----------------
Let's not make those `noexcept` as an extension just yet. That will give us more leeway to change it in the future.


================
Comment at: libcxx/include/charconv:1699
+    const chars_format _Fmt) noexcept /* strengthened */ {
+    return _Floating_to_chars<_Floating_to_chars_overload::_Format_only>(
+        _First, _Last, static_cast<double>(_Value), _Fmt, 0);
----------------
It should be possible to move these `_Floating_to_chars` functions to the dylib as well. In fact, I think what I'd do is move the definition of `to_chars` itself to the dylib, so that it's the only thing that needs to remain ABI stable. We know that won't change, since it's part of the spec.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70631



More information about the libcxx-commits mailing list