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

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 16 10:57:24 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); }
----------------
Zingam wrote:

https://github.com/frederick-vs-ja/llvm-project/commit/78f270aeecece7a094578f1a52a10ae87904c627 - this looks like a better alternative to my experiments in implementing this.

BTW I wanted to get the CI green with what I have so far. I still haven't.

Would you like to update this PR with your changes or wait for whenever we can/decide to pursue this paper further or create a new PR?

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


More information about the libcxx-commits mailing list