[libcxx-commits] [libcxx] [libc++] P3391R2: `constexpr` integral overloads of `to_(w)string` (PR #205025)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 26 06:22:02 PDT 2026


================
@@ -3774,12 +3777,15 @@ stoull(const string& __str, size_t* __idx = nullptr, int __base = 10);
 [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI double stod(const string& __str, size_t* __idx = nullptr);
 [[__nodiscard__]] _LIBCPP_EXPORTED_FROM_ABI long double stold(const string& __str, size_t* __idx = nullptr);
 
+#  if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY)
----------------
frederick-vs-ja wrote:

> Can we not make these constexpr in C++26?

I think I failed to understand this or locate the resolution. We need constexpr definitions in the header in C++26, and co-existing non-definition declarations also need to be constexpr.

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


More information about the libcxx-commits mailing list