@@ -1342,18 +1342,18 @@ private:
1342
1342
__node_holder __new_node = __construct_node (__src->__value_ );
1343
1343
1344
1344
unique_ptr<__node, __tree_deleter> __left (
1345
- __copy_construct_tree (static_cast <__node_pointer>(__src->__left_ )), __node_alloc_);
1346
- __node_pointer __right = __copy_construct_tree (static_cast <__node_pointer>(__src->__right_ ));
1345
+ __copy_construct_tree (std::__static_fancy_pointer_cast <__node_pointer>(__src->__left_ )), __node_alloc_);
1346
+ __node_pointer __right = __copy_construct_tree (std::__static_fancy_pointer_cast <__node_pointer>(__src->__right_ ));
1347
1347
1348
1348
__node_pointer __new_node_ptr = __new_node.release ();
1349
1349
1350
1350
__new_node_ptr->__is_black_ = __src->__is_black_ ;
1351
- __new_node_ptr->__left_ = static_cast <__node_base_pointer>(__left.release ());
1352
- __new_node_ptr->__right_ = static_cast <__node_base_pointer>(__right);
1351
+ __new_node_ptr->__left_ = std::__static_fancy_pointer_cast <__node_base_pointer>(__left.release ());
1352
+ __new_node_ptr->__right_ = std::__static_fancy_pointer_cast <__node_base_pointer>(__right);
1353
1353
if (__new_node_ptr->__left_ )
1354
- __new_node_ptr->__left_ ->__parent_ = static_cast <__end_node_pointer>(__new_node_ptr);
1354
+ __new_node_ptr->__left_ ->__parent_ = std::__static_fancy_pointer_cast <__end_node_pointer>(__new_node_ptr);
1355
1355
if (__new_node_ptr->__right_ )
1356
- __new_node_ptr->__right_ ->__parent_ = static_cast <__end_node_pointer>(__new_node_ptr);
1356
+ __new_node_ptr->__right_ ->__parent_ = std::__static_fancy_pointer_cast <__end_node_pointer>(__new_node_ptr);
1357
1357
return __new_node_ptr;
1358
1358
}
1359
1359
@@ -1363,7 +1363,7 @@ private:
1363
1363
#ifdef _LIBCPP_COMPILER_CLANG_BASED // FIXME: GCC complains about not being able to always_inline a recursive function
1364
1364
_LIBCPP_HIDE_FROM_ABI
1365
1365
#endif
1366
- __node_pointer
1366
+ _LIBCPP_CONSTEXPR_SINCE_CXX26 __node_pointer
1367
1367
__copy_assign_tree (__node_pointer __dest, __node_pointer __src) {
1368
1368
if (!__src) {
1369
1369
destroy (__dest);
@@ -1375,24 +1375,24 @@ private:
1375
1375
1376
1376
// If we already have a left node in the destination tree, reuse it and copy-assign recursively
1377
1377
if (__dest->__left_ ) {
1378
- __dest->__left_ = static_cast <__node_base_pointer>(__copy_assign_tree (
1379
- static_cast <__node_pointer>(__dest->__left_ ), static_cast <__node_pointer>(__src->__left_ )));
1378
+ __dest->__left_ = std::__static_fancy_pointer_cast <__node_base_pointer>(__copy_assign_tree (
1379
+ std::__static_fancy_pointer_cast <__node_pointer>(__dest->__left_ ), std::__static_fancy_pointer_cast <__node_pointer>(__src->__left_ )));
1380
1380
1381
1381
// Otherwise, we must create new nodes; copy-construct from here on
1382
1382
} else if (__src->__left_ ) {
1383
- auto __new_left = __copy_construct_tree (static_cast <__node_pointer>(__src->__left_ ));
1384
- __dest->__left_ = static_cast <__node_base_pointer>(__new_left);
1385
- __new_left->__parent_ = static_cast <__end_node_pointer>(__dest);
1383
+ auto __new_left = __copy_construct_tree (std::__static_fancy_pointer_cast <__node_pointer>(__src->__left_ ));
1384
+ __dest->__left_ = std::__static_fancy_pointer_cast <__node_base_pointer>(__new_left);
1385
+ __new_left->__parent_ = std::__static_fancy_pointer_cast <__end_node_pointer>(__dest);
1386
1386
}
1387
1387
1388
1388
// Identical to the left case above, just for the right nodes
1389
1389
if (__dest->__right_ ) {
1390
- __dest->__right_ = static_cast <__node_base_pointer>(__copy_assign_tree (
1391
- static_cast <__node_pointer>(__dest->__right_ ), static_cast <__node_pointer>(__src->__right_ )));
1390
+ __dest->__right_ = std::__static_fancy_pointer_cast <__node_base_pointer>(__copy_assign_tree (
1391
+ std::__static_fancy_pointer_cast <__node_pointer>(__dest->__right_ ), std::__static_fancy_pointer_cast <__node_pointer>(__src->__right_ )));
1392
1392
} else if (__src->__right_ ) {
1393
- auto __new_right = __copy_construct_tree (static_cast <__node_pointer>(__src->__right_ ));
1394
- __dest->__right_ = static_cast <__node_base_pointer>(__new_right);
1395
- __new_right->__parent_ = static_cast <__end_node_pointer>(__dest);
1393
+ auto __new_right = __copy_construct_tree (std::__static_fancy_pointer_cast <__node_pointer>(__src->__right_ ));
1394
+ __dest->__right_ = std::__static_fancy_pointer_cast <__node_base_pointer>(__new_right);
1395
+ __new_right->__parent_ = std::__static_fancy_pointer_cast <__end_node_pointer>(__dest);
1396
1396
}
1397
1397
1398
1398
return __dest;
@@ -1469,14 +1469,14 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>& __tree<_Tp, _Co
1469
1469
__copy_assign_alloc (__t );
1470
1470
1471
1471
if (__size_ != 0 ) {
1472
- *__root_ptr () = static_cast <__node_base_pointer>(__copy_assign_tree (__root (), __t .__root ()));
1472
+ *__root_ptr () = std::__static_fancy_pointer_cast <__node_base_pointer>(__copy_assign_tree (__root (), __t .__root ()));
1473
1473
} else {
1474
- *__root_ptr () = static_cast <__node_base_pointer>(__copy_construct_tree (__t .__root ()));
1474
+ *__root_ptr () = std::__static_fancy_pointer_cast <__node_base_pointer>(__copy_construct_tree (__t .__root ()));
1475
1475
if (__root ())
1476
1476
__root ()->__parent_ = __end_node ();
1477
1477
}
1478
1478
__begin_node_ =
1479
- __end_node ()->__left_ ? static_cast <__end_node_pointer>(std::__tree_min (__end_node ()->__left_ )) : __end_node ();
1479
+ __end_node ()->__left_ ? std::__static_fancy_pointer_cast <__end_node_pointer>(std::__tree_min (__end_node ()->__left_ )) : __end_node ();
1480
1480
__size_ = __t .size ();
1481
1481
1482
1482
return *this ;
@@ -1533,9 +1533,9 @@ _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::__tree(const __
1533
1533
if (__t .size () == 0 )
1534
1534
return ;
1535
1535
1536
- *__root_ptr () = static_cast <__node_base_pointer>(__copy_construct_tree (__t .__root ()));
1536
+ *__root_ptr () = std::__static_fancy_pointer_cast <__node_base_pointer>(__copy_construct_tree (__t .__root ()));
1537
1537
__root ()->__parent_ = __end_node ();
1538
- __begin_node_ = static_cast <__end_node_pointer>(std::__tree_min (__end_node ()->__left_ ));
1538
+ __begin_node_ = std::__static_fancy_pointer_cast <__end_node_pointer>(std::__tree_min (__end_node ()->__left_ ));
1539
1539
__size_ = __t .size ();
1540
1540
}
1541
1541
0 commit comments