diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table index c59d8d5bf383a..78f2f3bfd2f4c 100644 --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -852,15 +852,6 @@ public: template _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args); - _LIBCPP_HIDE_FROM_ABI pair __insert_unique(__container_value_type&& __x) { - return __emplace_unique_key_args(_NodeTypes::__get_key(__x), std::move(__x)); - } - - template , __container_value_type>::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI pair __insert_unique(_Pp&& __x) { - return __emplace_unique(std::forward<_Pp>(__x)); - } - template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI void __insert_unique_from_orphaned_node(value_type&& __value) { using __key_type = typename _NodeTypes::key_type; @@ -877,16 +868,6 @@ public: __h.release(); } - template - _LIBCPP_HIDE_FROM_ABI iterator __insert_multi(_Pp&& __x) { - return __emplace_multi(std::forward<_Pp>(__x)); - } - - template - _LIBCPP_HIDE_FROM_ABI iterator __insert_multi(const_iterator __p, _Pp&& __x) { - return __emplace_hint_multi(__p, std::forward<_Pp>(__x)); - } - template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI void __insert_multi_from_orphaned_node(value_type&& __value) { using __key_type = typename _NodeTypes::key_type; @@ -903,10 +884,6 @@ public: __h.release(); } - _LIBCPP_HIDE_FROM_ABI pair __insert_unique(const __container_value_type& __x) { - return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x); - } - #if _LIBCPP_STD_VER >= 17 template _LIBCPP_HIDE_FROM_ABI _InsertReturnType __node_handle_insert_unique(_NodeHandle&& __nh); @@ -1336,7 +1313,7 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __ __deallocate_node(__cache); } for (; __first != __last; ++__first) - __insert_unique(*__first); + __emplace_unique(*__first); } template @@ -1368,7 +1345,7 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __f __deallocate_node(__cache); } for (; __first != __last; ++__first) - __insert_multi(_NodeTypes::__get_value(*__first)); + __emplace_multi(_NodeTypes::__get_value(*__first)); } template diff --git a/libcxx/include/__tree b/libcxx/include/__tree index 9d4ba3ad0639c..b3c0ece8e5fdb 100644 --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -1015,32 +1015,6 @@ public: return __emplace_hint_unique_key_args(__p, __x.first, std::forward<_Pp>(__x)).first; } - _LIBCPP_HIDE_FROM_ABI pair __insert_unique(const value_type& __v) { - return __emplace_unique_key_args(__v, __v); - } - - _LIBCPP_HIDE_FROM_ABI iterator __insert_unique(const_iterator __p, const value_type& __v) { - return __emplace_hint_unique_key_args(__p, __v, __v).first; - } - - _LIBCPP_HIDE_FROM_ABI pair __insert_unique(value_type&& __v) { - return __emplace_unique_key_args(__v, std::move(__v)); - } - - _LIBCPP_HIDE_FROM_ABI iterator __insert_unique(const_iterator __p, value_type&& __v) { - return __emplace_hint_unique_key_args(__p, __v, std::move(__v)).first; - } - - template , value_type>::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI pair __insert_unique(_Vp&& __v) { - return __emplace_unique(std::forward<_Vp>(__v)); - } - - template , value_type>::value, int> = 0> - _LIBCPP_HIDE_FROM_ABI iterator __insert_unique(const_iterator __p, _Vp&& __v) { - return __emplace_hint_unique(__p, std::forward<_Vp>(__v)); - } - template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI void __insert_unique_from_orphaned_node(const_iterator __p, __get_node_value_type_t<_Tp>&& __value) { @@ -1052,22 +1026,6 @@ public: __emplace_hint_unique(__p, std::move(__value)); } - _LIBCPP_HIDE_FROM_ABI iterator __insert_multi(value_type&& __v) { return __emplace_multi(std::move(__v)); } - - _LIBCPP_HIDE_FROM_ABI iterator __insert_multi(const_iterator __p, value_type&& __v) { - return __emplace_hint_multi(__p, std::move(__v)); - } - - template - _LIBCPP_HIDE_FROM_ABI iterator __insert_multi(_Vp&& __v) { - return __emplace_multi(std::forward<_Vp>(__v)); - } - - template - _LIBCPP_HIDE_FROM_ABI iterator __insert_multi(const_iterator __p, _Vp&& __v) { - return __emplace_hint_multi(__p, std::forward<_Vp>(__v)); - } - template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI void __insert_multi_from_orphaned_node(const_iterator __p, value_type&& __value) { __emplace_hint_multi(__p, const_cast(__value.first), std::move(__value.second)); @@ -1360,7 +1318,7 @@ void __tree<_Tp, _Compare, _Allocator>::__assign_unique(_ForwardIterator __first } } for (; __first != __last; ++__first) - __insert_unique(*__first); + __emplace_unique(*__first); } template @@ -1380,7 +1338,7 @@ void __tree<_Tp, _Compare, _Allocator>::__assign_multi(_InputIterator __first, _ } const_iterator __e = end(); for (; __first != __last; ++__first) - __insert_multi(__e, *__first); + __emplace_hint_multi(__e, *__first); } template diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map index da2a34aa56dfb..d6b92204f4376 100644 --- a/libcxx/include/ext/hash_map +++ b/libcxx/include/ext/hash_map @@ -520,7 +520,7 @@ public: _LIBCPP_HIDE_FROM_ABI const_iterator end() const { return __table_.end(); } _LIBCPP_HIDE_FROM_ABI std::pair insert(const value_type& __x) { - return __table_.__insert_unique(__x); + return __table_.__emplace_unique(__x); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x).first; } template @@ -625,7 +625,7 @@ template template inline void hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) { for (; __first != __last; ++__first) - __table_.__insert_unique(*__first); + __table_.__emplace_unique(*__first); } template @@ -744,7 +744,7 @@ public: _LIBCPP_HIDE_FROM_ABI const_iterator begin() const { return __table_.begin(); } _LIBCPP_HIDE_FROM_ABI const_iterator end() const { return __table_.end(); } - _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__insert_multi(__x); } + _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__emplace_unique(__x); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x); } template _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last); @@ -831,7 +831,7 @@ template template inline void hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) { for (; __first != __last; ++__first) - __table_.__insert_multi(*__first); + __table_.__emplace_unique(*__first); } template diff --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set index 1c94130246b63..7fd5df24ed3a8 100644 --- a/libcxx/include/ext/hash_set +++ b/libcxx/include/ext/hash_set @@ -279,7 +279,7 @@ public: _LIBCPP_HIDE_FROM_ABI const_iterator end() const { return __table_.end(); } _LIBCPP_HIDE_FROM_ABI std::pair insert(const value_type& __x) { - return __table_.__insert_unique(__x); + return __table_.__emplace_unique(__x); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x).first; } template @@ -365,7 +365,7 @@ template template inline void hash_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) { for (; __first != __last; ++__first) - __table_.__insert_unique(*__first); + __table_.__emplace_unique(*__first); } template @@ -458,7 +458,7 @@ public: _LIBCPP_HIDE_FROM_ABI const_iterator begin() const { return __table_.begin(); } _LIBCPP_HIDE_FROM_ABI const_iterator end() const { return __table_.end(); } - _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__insert_multi(__x); } + _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__emplace_unique(__x); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x); } template _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last); @@ -543,7 +543,7 @@ template template inline void hash_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) { for (; __first != __last; ++__first) - __table_.__insert_multi(*__first); + __table_.__emplace_unique(*__first); } template diff --git a/libcxx/include/map b/libcxx/include/map index 6c271392911dc..f441768f2f8e4 100644 --- a/libcxx/include/map +++ b/libcxx/include/map @@ -1073,29 +1073,29 @@ public: template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI pair insert(_Pp&& __p) { - return __tree_.__insert_unique(std::forward<_Pp>(__p)); + return __tree_.__emplace_unique(std::forward<_Pp>(__p)); } template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) { - return __tree_.__insert_unique(__pos.__i_, std::forward<_Pp>(__p)); + return __tree_.__emplace_hint_unique(__pos.__i_, std::forward<_Pp>(__p)); } # endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __v) { return __tree_.__insert_unique(__v); } + _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __v) { return __tree_.__emplace_unique(__v); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) { - return __tree_.__insert_unique(__p.__i_, __v); + return __tree_.__emplace_hint_unique(__p.__i_, __v); } # ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI pair insert(value_type&& __v) { - return __tree_.__insert_unique(std::move(__v)); + return __tree_.__emplace_unique(std::move(__v)); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) { - return __tree_.__insert_unique(__p.__i_, std::move(__v)); + return __tree_.__emplace_hint_unique(__p.__i_, std::move(__v)); } _LIBCPP_HIDE_FROM_ABI void insert(initializer_list __il) { insert(__il.begin(), __il.end()); } @@ -1756,34 +1756,34 @@ public: template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator insert(_Pp&& __p) { - return __tree_.__insert_multi(std::forward<_Pp>(__p)); + return __tree_.__emplace_multi(std::forward<_Pp>(__p)); } template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __pos, _Pp&& __p) { - return __tree_.__insert_multi(__pos.__i_, std::forward<_Pp>(__p)); + return __tree_.__emplace_hint_multi(__pos.__i_, std::forward<_Pp>(__p)); } - _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) { return __tree_.__insert_multi(std::move(__v)); } + _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) { return __tree_.__emplace_multi(std::move(__v)); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) { - return __tree_.__insert_multi(__p.__i_, std::move(__v)); + return __tree_.__emplace_hint_multi(__p.__i_, std::move(__v)); } _LIBCPP_HIDE_FROM_ABI void insert(initializer_list __il) { insert(__il.begin(), __il.end()); } # endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) { return __tree_.__insert_multi(__v); } + _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) { return __tree_.__emplace_multi(__v); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) { - return __tree_.__insert_multi(__p.__i_, __v); + return __tree_.__emplace_hint_multi(__p.__i_, __v); } template _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __f, _InputIterator __l) { for (const_iterator __e = cend(); __f != __l; ++__f) - __tree_.__insert_multi(__e.__i_, *__f); + __tree_.__emplace_hint_multi(__e.__i_, *__f); } # if _LIBCPP_STD_VER >= 23 @@ -1791,7 +1791,7 @@ public: _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) { const_iterator __end = cend(); for (auto&& __element : __range) { - __tree_.__insert_multi(__end.__i_, std::forward(__element)); + __tree_.__emplace_hint_multi(__end.__i_, std::forward(__element)); } } # endif diff --git a/libcxx/include/set b/libcxx/include/set index aeea98adf582b..b4272172de5d7 100644 --- a/libcxx/include/set +++ b/libcxx/include/set @@ -740,15 +740,15 @@ public: } # endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __v) { return __tree_.__insert_unique(__v); } + _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __v) { return __tree_.__emplace_unique(__v); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) { - return __tree_.__insert_unique(__p, __v); + return __tree_.__emplace_hint_unique(__p, __v); } template _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __f, _InputIterator __l) { for (const_iterator __e = cend(); __f != __l; ++__f) - __tree_.__insert_unique(__e, *__f); + __tree_.__emplace_hint_unique(__e, *__f); } # if _LIBCPP_STD_VER >= 23 @@ -756,18 +756,18 @@ public: _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) { const_iterator __end = cend(); for (auto&& __element : __range) { - __tree_.__insert_unique(__end, std::forward(__element)); + __tree_.__emplace_hint_unique(__end, std::forward(__element)); } } # endif # ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI pair insert(value_type&& __v) { - return __tree_.__insert_unique(std::move(__v)); + return __tree_.__emplace_unique(std::move(__v)); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) { - return __tree_.__insert_unique(__p, std::move(__v)); + return __tree_.__emplace_hint_unique(__p, std::move(__v)); } _LIBCPP_HIDE_FROM_ABI void insert(initializer_list __il) { insert(__il.begin(), __il.end()); } @@ -1209,15 +1209,15 @@ public: } # endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) { return __tree_.__insert_multi(__v); } + _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __v) { return __tree_.__emplace_multi(__v); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v) { - return __tree_.__insert_multi(__p, __v); + return __tree_.__emplace_hint_multi(__p, __v); } template _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __f, _InputIterator __l) { for (const_iterator __e = cend(); __f != __l; ++__f) - __tree_.__insert_multi(__e, *__f); + __tree_.__emplace_hint_multi(__e, *__f); } # if _LIBCPP_STD_VER >= 23 @@ -1225,16 +1225,16 @@ public: _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) { const_iterator __end = cend(); for (auto&& __element : __range) { - __tree_.__insert_multi(__end, std::forward(__element)); + __tree_.__emplace_hint_multi(__end, std::forward(__element)); } } # endif # ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) { return __tree_.__insert_multi(std::move(__v)); } + _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __v) { return __tree_.__emplace_multi(std::move(__v)); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __v) { - return __tree_.__insert_multi(__p, std::move(__v)); + return __tree_.__emplace_hint_multi(__p, std::move(__v)); } _LIBCPP_HIDE_FROM_ABI void insert(initializer_list __il) { insert(__il.begin(), __il.end()); } diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map index 484f22ce5d72d..30d7385673adf 100644 --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -1136,7 +1136,7 @@ public: _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); } _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); } - _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __x) { return __table_.__insert_unique(__x); } + _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __x) { return __table_.__emplace_unique(__x); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x).first; } @@ -1147,7 +1147,7 @@ public: template <_ContainerCompatibleRange _Range> _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) { for (auto&& __element : __range) { - __table_.__insert_unique(std::forward(__element)); + __table_.__emplace_unique(std::forward(__element)); } } # endif @@ -1156,16 +1156,16 @@ public: _LIBCPP_HIDE_FROM_ABI void insert(initializer_list __il) { insert(__il.begin(), __il.end()); } _LIBCPP_HIDE_FROM_ABI pair insert(value_type&& __x) { - return __table_.__insert_unique(std::move(__x)); + return __table_.__emplace_unique(std::move(__x)); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, value_type&& __x) { - return __table_.__insert_unique(std::move(__x)).first; + return __table_.__emplace_unique(std::move(__x)).first; } template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI pair insert(_Pp&& __x) { - return __table_.__insert_unique(std::forward<_Pp>(__x)); + return __table_.__emplace_unique(std::forward<_Pp>(__x)); } template ::value, int> = 0> @@ -1640,7 +1640,7 @@ template template inline void unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) { for (; __first != __last; ++__first) - __table_.__insert_unique(*__first); + __table_.__emplace_unique(*__first); } # ifndef _LIBCPP_CXX03_LANG @@ -1944,10 +1944,10 @@ public: _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return __table_.begin(); } _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return __table_.end(); } - _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__insert_multi(__x); } + _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__emplace_multi(__x); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x) { - return __table_.__insert_multi(__p.__i_, __x); + return __table_.__emplace_hint_multi(__p.__i_, __x); } template @@ -1957,27 +1957,27 @@ public: template <_ContainerCompatibleRange _Range> _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) { for (auto&& __element : __range) { - __table_.__insert_multi(std::forward(__element)); + __table_.__emplace_multi(std::forward(__element)); } } # endif # ifndef _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI void insert(initializer_list __il) { insert(__il.begin(), __il.end()); } - _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) { return __table_.__insert_multi(std::move(__x)); } + _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) { return __table_.__emplace_multi(std::move(__x)); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x) { - return __table_.__insert_multi(__p.__i_, std::move(__x)); + return __table_.__emplace_hint_multi(__p.__i_, std::move(__x)); } template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator insert(_Pp&& __x) { - return __table_.__insert_multi(std::forward<_Pp>(__x)); + return __table_.__emplace_multi(std::forward<_Pp>(__x)); } template ::value, int> = 0> _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _Pp&& __x) { - return __table_.__insert_multi(__p.__i_, std::forward<_Pp>(__x)); + return __table_.__emplace_hint_multi(__p.__i_, std::forward<_Pp>(__x)); } template @@ -2396,7 +2396,7 @@ template template inline void unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) { for (; __first != __last; ++__first) - __table_.__insert_multi(*__first); + __table_.__emplace_multi(*__first); } template diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set index 1412badbe37f8..475715db62bdb 100644 --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -769,13 +769,13 @@ public: } _LIBCPP_HIDE_FROM_ABI pair insert(value_type&& __x) { - return __table_.__insert_unique(std::move(__x)); + return __table_.__emplace_unique(std::move(__x)); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, value_type&& __x) { return insert(std::move(__x)).first; } _LIBCPP_HIDE_FROM_ABI void insert(initializer_list __il) { insert(__il.begin(), __il.end()); } # endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __x) { return __table_.__insert_unique(__x); } + _LIBCPP_HIDE_FROM_ABI pair insert(const value_type& __x) { return __table_.__emplace_unique(__x); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator, const value_type& __x) { return insert(__x).first; } template @@ -785,7 +785,7 @@ public: template <_ContainerCompatibleRange _Range> _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) { for (auto&& __element : __range) { - __table_.__insert_unique(std::forward(__element)); + __table_.__emplace_unique(std::forward(__element)); } } # endif @@ -1096,7 +1096,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(unordered_set&& __u, if (__a != __u.get_allocator()) { iterator __i = __u.begin(); while (__u.size() != 0) - __table_.__insert_unique(std::move(__u.__table_.remove(__i++)->__get_value())); + __table_.__emplace_unique(std::move(__u.__table_.remove(__i++)->__get_value())); } } @@ -1146,7 +1146,7 @@ template template inline void unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) { for (; __first != __last; ++__first) - __table_.__insert_unique(*__first); + __table_.__emplace_unique(*__first); } template @@ -1374,17 +1374,17 @@ public: return __table_.__emplace_hint_multi(__p, std::forward<_Args>(__args)...); } - _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) { return __table_.__insert_multi(std::move(__x)); } + _LIBCPP_HIDE_FROM_ABI iterator insert(value_type&& __x) { return __table_.__emplace_multi(std::move(__x)); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x) { - return __table_.__insert_multi(__p, std::move(__x)); + return __table_.__emplace_hint_multi(__p, std::move(__x)); } _LIBCPP_HIDE_FROM_ABI void insert(initializer_list __il) { insert(__il.begin(), __il.end()); } # endif // _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__insert_multi(__x); } + _LIBCPP_HIDE_FROM_ABI iterator insert(const value_type& __x) { return __table_.__emplace_multi(__x); } _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x) { - return __table_.__insert_multi(__p, __x); + return __table_.__emplace_hint_multi(__p, __x); } template @@ -1394,7 +1394,7 @@ public: template <_ContainerCompatibleRange _Range> _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) { for (auto&& __element : __range) { - __table_.__insert_multi(std::forward(__element)); + __table_.__emplace_multi(std::forward(__element)); } } # endif @@ -1714,7 +1714,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( if (__a != __u.get_allocator()) { iterator __i = __u.begin(); while (__u.size() != 0) - __table_.__insert_multi(std::move(__u.__table_.remove(__i++)->__get_value())); + __table_.__emplace_multi(std::move(__u.__table_.remove(__i++)->__get_value())); } } @@ -1764,7 +1764,7 @@ template template inline void unordered_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) { for (; __first != __last; ++__first) - __table_.__insert_multi(*__first); + __table_.__emplace_multi(*__first); } template diff --git a/libcxx/test/std/containers/map_allocator_requirement_test_templates.h b/libcxx/test/std/containers/map_allocator_requirement_test_templates.h index 74dc8b15928a9..e37f406a92853 100644 --- a/libcxx/test/std/containers/map_allocator_requirement_test_templates.h +++ b/libcxx/test/std/containers/map_allocator_requirement_test_templates.h @@ -50,7 +50,7 @@ void testMapInsert() { // Testing C::insert(value_type&) Container c; ValueTp v(42, 1); - cc->expect(); + cc->expect(); assert(c.insert(v).second); assert(!cc->unchecked()); { @@ -76,7 +76,7 @@ void testMapInsert() { // Testing C::insert(const value_type&&) Container c; const ValueTp v(42, 1); - cc->expect(); + cc->expect(); assert(c.insert(std::move(v)).second); assert(!cc->unchecked()); { @@ -139,7 +139,7 @@ void testMapInsert() { // Testing C::insert(Iter, Iter) for *Iter = value_type& Container c; ValueTp ValueList[] = {ValueTp(1, 1), ValueTp(2, 1), ValueTp(3, 1)}; - cc->expect(3); + cc->expect(3); c.insert(std::begin(ValueList), std::end(ValueList)); assert(!cc->unchecked()); { @@ -180,7 +180,7 @@ void testMapInsertHint() { // Testing C::insert(p, value_type&) Container c; ValueTp v(42, 1); - cc->expect(); + cc->expect(); It ret = c.insert(c.end(), v); assert(ret != c.end()); assert(c.size() == 1); @@ -229,7 +229,7 @@ void testMapInsertHint() { // Testing C::insert(p, const value_type&&) Container c; const ValueTp v(42, 1); - cc->expect(); + cc->expect(); It ret = c.insert(c.end(), std::move(v)); assert(ret != c.end()); assert(c.size() == 1); diff --git a/libcxx/test/std/containers/set_allocator_requirement_test_templates.h b/libcxx/test/std/containers/set_allocator_requirement_test_templates.h index 9ab5c50e9012e..10552a5b9ee21 100644 --- a/libcxx/test/std/containers/set_allocator_requirement_test_templates.h +++ b/libcxx/test/std/containers/set_allocator_requirement_test_templates.h @@ -125,7 +125,7 @@ void testSetInsert() { // Testing C::insert(Iter, Iter) for *Iter = value_type&" Container c; ValueTp ValueList[] = {ValueTp(1), ValueTp(2), ValueTp(3)}; - cc->expect(3); + cc->expect(3); c.insert(std::begin(ValueList), std::end(ValueList)); assert(!cc->unchecked()); {