@@ -296,8 +296,7 @@ struct __forward_node_traits {
296296# endif
297297
298298 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI static __begin_node_pointer __as_iter_node (__node_pointer __p) {
299- return __p ? pointer_traits<__begin_node_pointer>::pointer_to (*static_cast <__begin_node*>(std::addressof (*__p)))
300- : static_cast <__begin_node_pointer>(nullptr );
299+ return __static_fancy_pointer_cast<__begin_node_pointer>(__p);
301300 }
302301};
303302
@@ -312,9 +311,7 @@ struct __forward_begin_node {
312311 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit __forward_begin_node (pointer __n) : __next_(__n) {}
313312
314313 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __begin_node_pointer __next_as_begin () const {
315- return __next_ ? pointer_traits<__begin_node_pointer>::pointer_to (
316- *static_cast <__forward_begin_node*>(std::addressof (*__next_)))
317- : static_cast <__begin_node_pointer>(nullptr );
314+ return __static_fancy_pointer_cast<__begin_node_pointer>(__next_);
318315 }
319316};
320317
@@ -370,8 +367,7 @@ class __forward_list_iterator {
370367
371368 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __begin_node_pointer __get_begin () const { return __ptr_; }
372369 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __node_pointer __get_unsafe_node_pointer () const {
373- return __ptr_ ? pointer_traits<__node_pointer>::pointer_to (*static_cast <__node_type*>(std::addressof (*__ptr_)))
374- : static_cast <__node_pointer>(nullptr );
370+ return __static_fancy_pointer_cast<__node_pointer>(__ptr_);
375371 }
376372
377373 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit __forward_list_iterator (nullptr_t ) _NOEXCEPT
@@ -440,8 +436,7 @@ class __forward_list_const_iterator {
440436
441437 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __begin_node_pointer __get_begin () const { return __ptr_; }
442438 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __node_pointer __get_unsafe_node_pointer () const {
443- return __ptr_ ? pointer_traits<__node_pointer>::pointer_to (*static_cast <__node_type*>(std::addressof (*__ptr_)))
444- : static_cast <__node_pointer>(nullptr );
439+ return __static_fancy_pointer_cast<__node_pointer>(__ptr_);
445440 }
446441
447442 _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit __forward_list_const_iterator (nullptr_t ) _NOEXCEPT
0 commit comments