Skip to content

Commit f732308

Browse files
local cf
1 parent c448834 commit f732308

File tree

1 file changed

+30
-35
lines changed

1 file changed

+30
-35
lines changed

libcxx/include/__tree

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ public:
581581
__parent_ = std::__static_fancy_pointer_cast<__end_node_pointer>(__p);
582582
}
583583

584-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_node_base() = default;
584+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_node_base() = default;
585585
__tree_node_base(__tree_node_base const&) = delete;
586586
__tree_node_base& operator=(__tree_node_base const&) = delete;
587587
};
@@ -609,9 +609,7 @@ private:
609609
_ALIGNAS_TYPE(__node_value_type) unsigned char __buffer_[sizeof(__node_value_type)];
610610

611611
public:
612-
_LIBCPP_HIDE_FROM_ABI __node_value_type& __get_value() {
613-
return *reinterpret_cast<__node_value_type*>(__buffer_);
614-
}
612+
_LIBCPP_HIDE_FROM_ABI __node_value_type& __get_value() { return *reinterpret_cast<__node_value_type*>(__buffer_); }
615613
#endif
616614

617615
template <class _Alloc, class... _Args>
@@ -1054,17 +1052,17 @@ public:
10541052
std::forward<_Args>(__args)...);
10551053
}
10561054

1057-
10581055
template <class... _Args>
10591056
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool>
10601057
__emplace_hint_unique__sfinae(true_type, const_iterator __p, _Args&&... __args) {
1061-
return __emplace_hint_unique(__p, __args...);
1058+
return __emplace_hint_unique(__p, __args...);
10621059
}
10631060

10641061
template <class... _Args>
10651062
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool>
1066-
__emplace_hint_unique__sfinae(false_type, const_iterator , _Args&&... ) {
1067-
// This method body should never be run. It only exists to allow for compilation. See note in __insert_unique_from_orphaned_node for more information.
1063+
__emplace_hint_unique__sfinae(false_type, const_iterator, _Args&&...) {
1064+
// This method body should never be run. It only exists to allow for compilation. See note in
1065+
// __insert_unique_from_orphaned_node for more information.
10681066
return pair<iterator, bool>(iterator(__node_pointer()), false);
10691067
}
10701068

@@ -1073,16 +1071,16 @@ public:
10731071
__insert_unique_from_orphaned_node(const_iterator __p, __get_node_value_type_t<_Tp>&& __value) {
10741072
#if _LIBCPP_STD_VER >= 26
10751073
if (std::is_constant_evaluated() && std::is_copy_constructible_v<decltype(__value.first)>) {
1076-
1077-
// We create a sfinae wrapper method here, because if the __emplace_hint_unique method gets template instantiated within __insert_unique_from_orphaned_node, the code will fail to compile where the value is not copy_constructible for runtime execution as well; unless we use `if constexpr`.
1078-
// Given the copy-constructible code path will be a performance regression, we want to restrict it to only execute during constant evaluation
1074+
// We create a sfinae wrapper method here, because if the __emplace_hint_unique method gets template instantiated
1075+
// within __insert_unique_from_orphaned_node, the code will fail to compile where the value is not
1076+
// copy_constructible for runtime execution as well; unless we use `if constexpr`. Given the copy-constructible
1077+
// code path will be a performance regression, we want to restrict it to only execute during constant evaluation
10791078
//, we need to delay the template instantiation
10801079
__emplace_hint_unique__sfinae(
1081-
integral_constant <
1082-
bool,
1083-
std::is_copy_constructible_v<decltype(__value.first)>
1084-
>(),
1085-
__p, std::move(__value.first), std::move(__value.second));
1080+
integral_constant< bool, std::is_copy_constructible_v<decltype(__value.first)> >(),
1081+
__p,
1082+
std::move(__value.first),
1083+
std::move(__value.second));
10861084
} else
10871085
#endif
10881086
{
@@ -1360,25 +1358,23 @@ private:
13601358
}
13611359
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {}
13621360

1363-
13641361
template <class _From, class _ValueT = _Tp, __enable_if_t<__is_tree_value_type_v<_ValueT>, int> = 0>
13651362
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
13661363
__assign_value__sfinae(true_type, __get_node_value_type_t<value_type>& __lhs, _From&& __rhs) {
1364+
__node_allocator& __na = __node_alloc();
1365+
__node_traits::destroy(__na, std::addressof(__lhs));
13671366

1368-
__node_allocator& __na = __node_alloc();
1369-
__node_traits::destroy(__na, std::addressof(__lhs));
1370-
1371-
using __node_value_type = __get_node_value_type_t<value_type>;
1372-
__node_value_type __tmp(__rhs.first, __rhs.second);
1373-
1374-
__node_traits::construct(__na, std::addressof(__lhs), std::move(__tmp));
1367+
using __node_value_type = __get_node_value_type_t<value_type>;
1368+
__node_value_type __tmp(__rhs.first, __rhs.second);
13751369

1370+
__node_traits::construct(__na, std::addressof(__lhs), std::move(__tmp));
13761371
}
13771372

13781373
template <class _From, class _ValueT = _Tp, __enable_if_t<__is_tree_value_type_v<_ValueT>, int> = 0>
13791374
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1380-
__assign_value__sfinae(false_type, __get_node_value_type_t<value_type>& , _From&& ) {
1381-
// This method body should never be run. It only exists to allow for compilation. See note in __assign_value for more information
1375+
__assign_value__sfinae(false_type, __get_node_value_type_t<value_type>&, _From&&) {
1376+
// This method body should never be run. It only exists to allow for compilation. See note in __assign_value for
1377+
// more information
13821378
}
13831379

13841380
template <class _From, class _ValueT = _Tp, __enable_if_t<__is_tree_value_type_v<_ValueT>, int> = 0>
@@ -1399,17 +1395,16 @@ private:
13991395
// we get around this by deleting __lhs and creating a new node in-place
14001396
// to avoid const_cast __lhs.first
14011397

1402-
// We create a sfinae wrapper method here, because if the body of the true_type overload for __assign_value__sfinae() gets template instantiated within __assign_value,
1403-
// the code will fail to compile where the value is not copy_constructible for runtime execution as well; unless we use `if constexpr`.
1404-
// Given the copy-constructible code path will be a performance regression, we want to restrict it to only execute during constant evaluation
1398+
// We create a sfinae wrapper method here, because if the body of the true_type overload for
1399+
// __assign_value__sfinae() gets template instantiated within __assign_value, the code will fail to compile where
1400+
// the value is not copy_constructible for runtime execution as well; unless we use `if constexpr`. Given the
1401+
// copy-constructible code path will be a performance regression, we want to restrict it to only execute during
1402+
// constant evaluation
14051403
//, we need to delay the template instantiation
14061404

1407-
__assign_value__sfinae(
1408-
std::integral_constant<bool, std::is_copy_constructible_v<decltype(__rhs.first)>>(),
1409-
std::forward<decltype(__lhs)>(__lhs),
1410-
std::forward<decltype(__rhs)>(__rhs)
1411-
);
1412-
1405+
__assign_value__sfinae(std::integral_constant<bool, std::is_copy_constructible_v<decltype(__rhs.first)>>(),
1406+
std::forward<decltype(__lhs)>(__lhs),
1407+
std::forward<decltype(__rhs)>(__rhs));
14131408

14141409
} else
14151410
#endif

0 commit comments

Comments
 (0)