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

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 22 09:57:13 PDT 2026


philnik777 wrote:

> If we expose dylib versions in C++26 mode and mark them `_LIBCPP_PREFERRED_OVERLOAD`, the additional `constexpr` versions won't wok at all. On the other hand, if we mark `constexpr` versions `_LIBCPP_PREFERRED_OVERLOAD`, the dylib versions wont't be used in C++26 mode even if they're exposed.

Can't you define a function which just sees the dylib overloads and call that from the C++26 overloads if they're not constant evaluated?

> > Just because it doesn't work with GCC doesn't mean we have to regress with clang.
> 
> I think I failed to understand what did you mean by "regress".

compile time and probably performance/code size.

P.S. I'd really like it if we were able to overload based on whether the call is `constexpr` or not for this sort of stuff.

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


More information about the libcxx-commits mailing list