diff options
Diffstat (limited to 'libcxx/include/set')
-rw-r--r-- | libcxx/include/set | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/libcxx/include/set b/libcxx/include/set index 05c1939..5190fc1 100644 --- a/libcxx/include/set +++ b/libcxx/include/set @@ -530,6 +530,7 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20 # include <__memory/allocator_traits.h> # include <__memory_resource/polymorphic_allocator.h> # include <__node_handle> +# include <__ranges/access.h> # include <__ranges/concepts.h> # include <__ranges/container_compatible_range.h> # include <__ranges/from_range.h> @@ -667,7 +668,7 @@ public: _LIBCPP_HIDE_FROM_ABI set& operator=(const set& __s) = default; # ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI set(set&& __s) noexcept(is_nothrow_move_constructible<__base>::value) = default; + _LIBCPP_HIDE_FROM_ABI set(set&& __s) = default; # endif // _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI explicit set(const allocator_type& __a) : __tree_(__a) {} @@ -699,10 +700,7 @@ public: return *this; } - _LIBCPP_HIDE_FROM_ABI set& operator=(set&& __s) noexcept(is_nothrow_move_assignable<__base>::value) { - __tree_ = std::move(__s.__tree_); - return *this; - } + _LIBCPP_HIDE_FROM_ABI set& operator=(set&& __s) = default; # endif // _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI ~set() { static_assert(sizeof(std::__diagnose_non_const_comparator<_Key, _Compare>()), ""); } @@ -1126,7 +1124,7 @@ public: _LIBCPP_HIDE_FROM_ABI multiset& operator=(const multiset& __s) = default; # ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s) noexcept(is_nothrow_move_constructible<__base>::value) = default; + _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s) = default; _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s, const allocator_type& __a); # endif // _LIBCPP_CXX03_LANG @@ -1158,10 +1156,7 @@ public: return *this; } - _LIBCPP_HIDE_FROM_ABI multiset& operator=(multiset&& __s) _NOEXCEPT_(is_nothrow_move_assignable<__base>::value) { - __tree_ = std::move(__s.__tree_); - return *this; - } + _LIBCPP_HIDE_FROM_ABI multiset& operator=(multiset&& __s) = default; # endif // _LIBCPP_CXX03_LANG _LIBCPP_HIDE_FROM_ABI ~multiset() { @@ -1205,18 +1200,14 @@ public: } template <class _InputIterator> - _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __f, _InputIterator __l) { - for (const_iterator __e = cend(); __f != __l; ++__f) - __tree_.__emplace_hint_multi(__e, *__f); + _LIBCPP_HIDE_FROM_ABI void insert(_InputIterator __first, _InputIterator __last) { + __tree_.__insert_range_multi(__first, __last); } # if _LIBCPP_STD_VER >= 23 template <_ContainerCompatibleRange<value_type> _Range> _LIBCPP_HIDE_FROM_ABI void insert_range(_Range&& __range) { - const_iterator __end = cend(); - for (auto&& __element : __range) { - __tree_.__emplace_hint_multi(__end, std::forward<decltype(__element)>(__element)); - } + __tree_.__insert_range_multi(ranges::begin(__range), ranges::end(__range)); } # endif |