@@ -1064,16 +1064,85 @@ public:
1064
1064
__emplace_hint_unique_key_args (const_iterator, _Key const &, _Args&&...);
1065
1065
1066
1066
template <class ... _Args>
1067
- pair<iterator, bool > __emplace_unique (_Args&&... __args);
1067
+ pair<iterator, bool > __emplace_unique_impl (_Args&&... __args);
1068
1068
1069
1069
template <class ... _Args>
1070
- iterator __emplace_hint_unique (const_iterator __p, _Args&&... __args);
1070
+ iterator __emplace_hint_unique_impl (const_iterator __p, _Args&&... __args);
1071
1071
1072
1072
template <class ... _Args>
1073
1073
iterator __emplace_multi (_Args&&... __args);
1074
1074
1075
1075
template <class ... _Args>
1076
1076
iterator __emplace_hint_multi (const_iterator __p, _Args&&... __args);
1077
+
1078
+ template <class _Pp >
1079
+ _LIBCPP_INLINE_VISIBILITY
1080
+ pair<iterator, bool > __emplace_unique (_Pp&& __x) {
1081
+ return __emplace_unique_extract_key (_VSTD::forward<_Pp>(__x),
1082
+ __can_extract_key<_Pp, key_type>());
1083
+ }
1084
+
1085
+ template <class ... _Args>
1086
+ _LIBCPP_INLINE_VISIBILITY
1087
+ pair<iterator, bool > __emplace_unique (_Args&&... __args) {
1088
+ return __emplace_unique_impl (_VSTD::forward<_Args>(__args)...);
1089
+ }
1090
+
1091
+ template <class _Pp >
1092
+ _LIBCPP_INLINE_VISIBILITY
1093
+ pair<iterator, bool >
1094
+ __emplace_unique_extract_key (_Pp&& __x, __extract_key_fail_tag) {
1095
+ return __emplace_unique_impl (_VSTD::forward<_Pp>(__x));
1096
+ }
1097
+
1098
+ template <class _Pp >
1099
+ _LIBCPP_INLINE_VISIBILITY
1100
+ pair<iterator, bool >
1101
+ __emplace_unique_extract_key (_Pp&& __x, __extract_key_self_tag) {
1102
+ return __emplace_unique_key_args (__x, _VSTD::forward<_Pp>(__x));
1103
+ }
1104
+
1105
+ template <class _Pp >
1106
+ _LIBCPP_INLINE_VISIBILITY
1107
+ pair<iterator, bool >
1108
+ __emplace_unique_extract_key (_Pp&& __x, __extract_key_first_tag) {
1109
+ return __emplace_unique_key_args (__x.first , _VSTD::forward<_Pp>(__x));
1110
+ }
1111
+
1112
+ template <class _Pp >
1113
+ _LIBCPP_INLINE_VISIBILITY
1114
+ iterator __emplace_hint_unique (const_iterator __p, _Pp&& __x) {
1115
+ return __emplace_hint_unique_extract_key (__p, _VSTD::forward<_Pp>(__x),
1116
+ __can_extract_key<_Pp, key_type>());
1117
+ }
1118
+
1119
+ template <class ... _Args>
1120
+ _LIBCPP_INLINE_VISIBILITY
1121
+ iterator __emplace_hint_unique (const_iterator __p, _Args&&... __args) {
1122
+ return __emplace_hint_unique_impl (__p, _VSTD::forward<_Args>(__args)...);
1123
+ }
1124
+
1125
+ template <class _Pp >
1126
+ _LIBCPP_INLINE_VISIBILITY
1127
+ iterator
1128
+ __emplace_hint_unique_extract_key (const_iterator __p, _Pp&& __x, __extract_key_fail_tag) {
1129
+ return __emplace_hint_unique_impl (__p, _VSTD::forward<_Pp>(__x));
1130
+ }
1131
+
1132
+ template <class _Pp >
1133
+ _LIBCPP_INLINE_VISIBILITY
1134
+ iterator
1135
+ __emplace_hint_unique_extract_key (const_iterator __p, _Pp&& __x, __extract_key_self_tag) {
1136
+ return __emplace_hint_unique_key_args (__p, __x, _VSTD::forward<_Pp>(__x));
1137
+ }
1138
+
1139
+ template <class _Pp >
1140
+ _LIBCPP_INLINE_VISIBILITY
1141
+ iterator
1142
+ __emplace_hint_unique_extract_key (const_iterator __p, _Pp&& __x, __extract_key_first_tag) {
1143
+ return __emplace_hint_unique_key_args (__p, __x.first , _VSTD::forward<_Pp>(__x));
1144
+ }
1145
+
1077
1146
#else
1078
1147
template <class _Key , class _Args >
1079
1148
_LIBCPP_INLINE_VISIBILITY
@@ -1989,7 +2058,7 @@ __tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&& ...__args)
1989
2058
template <class _Tp , class _Compare , class _Allocator >
1990
2059
template <class ... _Args>
1991
2060
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool >
1992
- __tree<_Tp, _Compare, _Allocator>::__emplace_unique (_Args&&... __args)
2061
+ __tree<_Tp, _Compare, _Allocator>::__emplace_unique_impl (_Args&&... __args)
1993
2062
{
1994
2063
__node_holder __h = __construct_node (_VSTD::forward<_Args>(__args)...);
1995
2064
__node_base_pointer __parent;
@@ -2008,7 +2077,7 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_unique(_Args&&... __args)
2008
2077
template <class _Tp , class _Compare , class _Allocator >
2009
2078
template <class ... _Args>
2010
2079
typename __tree<_Tp, _Compare, _Allocator>::iterator
2011
- __tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique (const_iterator __p, _Args&&... __args)
2080
+ __tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_impl (const_iterator __p, _Args&&... __args)
2012
2081
{
2013
2082
__node_holder __h = __construct_node (_VSTD::forward<_Args>(__args)...);
2014
2083
__node_base_pointer __parent;
0 commit comments