[libcxx-commits] [libcxx] [libc++] Make forward_list constexpr as	part of P3372R3 (PR #129435)
    Nikolas Klauser via libcxx-commits 
    libcxx-commits at lists.llvm.org
       
    Thu Mar  6 01:11:04 PST 2025
    
    
  
================
@@ -295,9 +295,12 @@ struct __forward_node_traits {
                 "the _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB macro to silence this diagnostic.");
 #  endif
 
-  _LIBCPP_HIDE_FROM_ABI static __begin_node_pointer __as_iter_node(__begin_node_pointer __p) { return __p; }
-  _LIBCPP_HIDE_FROM_ABI static __begin_node_pointer __as_iter_node(__node_pointer __p) {
-    return static_cast<__begin_node_pointer>(static_cast<__void_pointer>(__p));
+  _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI static __begin_node_pointer
+  __as_iter_node(__begin_node_pointer __p) {
+    return __p;
+  }
+  _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI static __begin_node_pointer __as_iter_node(__node_pointer __p) {
+    return std::__static_fancy_pointer_cast<__begin_node_pointer>(__p);
----------------
philnik777 wrote:
Why did this change? What's incorrect about the old version?
https://github.com/llvm/llvm-project/pull/129435
    
    
More information about the libcxx-commits
mailing list