[libcxx-commits] [libcxx] [libc++] Make forward_list constexpr as part of P3372R3 (PR #129435)

Peng Liu via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 5 13:05:44 PDT 2025


================
@@ -302,6 +302,14 @@ concept __resettable_smart_pointer_with_args = requires(_Smart __s, _Pointer __p
 
 #endif
 
+template <class _PtrTo, class _PtrFrom>
+_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI _PtrTo __static_fancy_pointer_cast(const _PtrFrom& __p) {
----------------
winner245 wrote:

The problem is that even without the cast to `__void_pointer`, the cast would fail in compile-time evaluation for fancy pointer (See: https://godbolt.org/z/E7jcezjnc). That's why I need `__static_fancy_pointer_cast`. 

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


More information about the libcxx-commits mailing list