@@ -1023,14 +1023,41 @@ public:
1023
1023
return __emplace_hint_unique_key_args (__p, __x.first , std::forward<_Pp>(__x)).first ;
1024
1024
}
1025
1025
1026
+ template <
1027
+ class _ValueT = _Tp,
1028
+ __enable_if_t <__is_tree_value_type<_ValueT>::value, int > = 0
1029
+ >
1030
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1031
+ __sfinae_call_emplace_hint_unique (const_iterator __p, __get_node_value_type_t <_Tp>&& __value, false_type) {
1032
+ // __emplace_hint_unique(__p, std::move(__value.first), std::move(__value.second));
1033
+ // static_assert(false, "Can not emplace during constant evaluation if the key is `const MoveOnly` ");
1034
+ (void )__p;
1035
+ (void )__value;
1036
+ }
1037
+
1038
+ template <
1039
+ class _ValueT = _Tp,
1040
+ __enable_if_t <__is_tree_value_type<_ValueT>::value, int > = 0
1041
+ >
1042
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1043
+ __sfinae_call_emplace_hint_unique (const_iterator __p, __get_node_value_type_t <_Tp>&& __value, true_type) {
1044
+ __emplace_hint_unique (__p, std::move (__value.first ), std::move (__value.second ));
1045
+ }
1046
+
1047
+
1026
1048
template <class _ValueT = _Tp, __enable_if_t <__is_tree_value_type<_ValueT>::value, int > = 0 >
1027
1049
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
1028
1050
__insert_unique_from_orphaned_node (const_iterator __p, __get_node_value_type_t <_Tp>&& __value) {
1029
1051
// fails here for move_alloc.pass.cpp
1030
1052
1031
1053
#if _LIBCPP_STD_VER >= 26
1032
1054
if (__libcpp_is_constant_evaluated ()) {
1033
- __emplace_hint_unique (__p, std::move (__value.first ), std::move (__value.second ));
1055
+ // static_assert(std::same_as_v<decltype(__value.first), double>);
1056
+ // __emplace_hint_unique(__p, std::move(__value.first), std::move(__value.second));
1057
+
1058
+ __sfinae_call_emplace_hint_unique (__p, std::move (__value),
1059
+ integral_constant<bool , is_copy_constructible<decltype (__value.first )>::value >()
1060
+ );
1034
1061
} else
1035
1062
#endif
1036
1063
{
0 commit comments