[libcxx-commits] [libcxx] [libc++] Remove unnecessary static_casts in std::forward_list (PR #130310)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sat Mar 8 01:30:44 PST 2025


================
@@ -296,7 +296,7 @@ struct __forward_node_traits {
 #  endif
 
   _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));
+    return static_cast<__begin_node_pointer>(__p);
   }
----------------
philnik777 wrote:

I think we should just inline this. That probably makes the code easier to read, since you don't have to guess what `__as_iter_node` means.

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


More information about the libcxx-commits mailing list