[libcxx-commits] [libcxx] WIP - [libc++][string] P2587R3: `to_string` or not `to_string` (PR #78100)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 14 01:15:45 PDT 2025


================
@@ -3939,9 +3939,22 @@ _LIBCPP_EXPORTED_FROM_ABI string to_string(long __val);
 _LIBCPP_EXPORTED_FROM_ABI string to_string(unsigned long __val);
 _LIBCPP_EXPORTED_FROM_ABI string to_string(long long __val);
 _LIBCPP_EXPORTED_FROM_ABI string to_string(unsigned long long __val);
+
+#  if _LIBCPP_STD_VER >= 26
+inline namespace __cpp26 {
+_LIBCPP_EXPORTED_FROM_ABI string __to_string(float __val);
+_LIBCPP_EXPORTED_FROM_ABI string __to_string(double __val);
+_LIBCPP_EXPORTED_FROM_ABI string __to_string(long double __val);
+
+inline _LIBCPP_HIDE_FROM_ABI string to_string(float __val) { return std::__to_string(__val); }
----------------
frederick-vs-ja wrote:

I think we can use `to_chars` here to avoid changing ABI.

https://github.com/llvm/llvm-project/pull/78100


More information about the libcxx-commits mailing list