diff options
Diffstat (limited to 'libcxx/include/set')
| -rw-r--r-- | libcxx/include/set | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/libcxx/include/set b/libcxx/include/set index ab3a4363499a..9a2eb12d0a25 100644 --- a/libcxx/include/set +++ b/libcxx/include/set @@ -571,16 +571,14 @@ public: typedef value_type& reference; typedef const value_type& const_reference; - static_assert((is_same<typename allocator_type::value_type, value_type>::value), + static_assert(is_same<typename allocator_type::value_type, value_type>::value, "Allocator::value_type must be same type as value_type"); private: typedef __tree<value_type, value_compare, allocator_type> __base; typedef allocator_traits<allocator_type> __alloc_traits; - static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); + static_assert(__check_valid_allocator<allocator_type>::value, ""); __base __tree_; @@ -659,7 +657,7 @@ public: } #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI set(set&& __s) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value) + _LIBCPP_HIDE_FROM_ABI set(set&& __s) noexcept(is_nothrow_move_constructible<__base>::value) : __tree_(std::move(__s.__tree_)) {} #endif // _LIBCPP_CXX03_LANG @@ -692,7 +690,7 @@ public: return *this; } - _LIBCPP_HIDE_FROM_ABI set& operator=(set&& __s) _NOEXCEPT_(is_nothrow_move_assignable<__base>::value) { + _LIBCPP_HIDE_FROM_ABI set& operator=(set&& __s) noexcept(is_nothrow_move_assignable<__base>::value) { __tree_ = std::move(__s.__tree_); return *this; } @@ -812,9 +810,7 @@ public: } #endif - _LIBCPP_HIDE_FROM_ABI void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable<__base>::value) { - __tree_.swap(__s.__tree_); - } + _LIBCPP_HIDE_FROM_ABI void swap(set& __s) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__s.__tree_); } _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT { return __tree_.__alloc(); } _LIBCPP_HIDE_FROM_ABI key_compare key_comp() const { return __tree_.value_comp(); } @@ -926,13 +922,15 @@ template <class _InputIterator, class _Allocator, class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>, class = enable_if_t<__is_allocator<_Allocator>::value, void>> -set(_InputIterator, _InputIterator, _Allocator) - -> set<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>; +set(_InputIterator, + _InputIterator, + _Allocator) -> set<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>; # if _LIBCPP_STD_VER >= 23 template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>> -set(from_range_t, _Range&&, _Allocator) - -> set<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>; +set(from_range_t, + _Range&&, + _Allocator) -> set<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>; # endif template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>> @@ -1028,16 +1026,14 @@ public: typedef value_type& reference; typedef const value_type& const_reference; - static_assert((is_same<typename allocator_type::value_type, value_type>::value), + static_assert(is_same<typename allocator_type::value_type, value_type>::value, "Allocator::value_type must be same type as value_type"); private: typedef __tree<value_type, value_compare, allocator_type> __base; typedef allocator_traits<allocator_type> __alloc_traits; - static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); + static_assert(__check_valid_allocator<allocator_type>::value, ""); __base __tree_; @@ -1119,7 +1115,7 @@ public: } #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value) + _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s) noexcept(is_nothrow_move_constructible<__base>::value) : __tree_(std::move(__s.__tree_)) {} _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s, const allocator_type& __a); @@ -1270,7 +1266,7 @@ public: } #endif - _LIBCPP_HIDE_FROM_ABI void swap(multiset& __s) _NOEXCEPT_(__is_nothrow_swappable<__base>::value) { + _LIBCPP_HIDE_FROM_ABI void swap(multiset& __s) _NOEXCEPT_(__is_nothrow_swappable_v<__base>) { __tree_.swap(__s.__tree_); } @@ -1378,8 +1374,9 @@ template <class _Key, class _Allocator = allocator<_Key>, class = enable_if_t<__is_allocator<_Allocator>::value, void>, class = enable_if_t<!__is_allocator<_Compare>::value, void>> -multiset(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator()) - -> multiset<_Key, _Compare, _Allocator>; +multiset(initializer_list<_Key>, + _Compare = _Compare(), + _Allocator = _Allocator()) -> multiset<_Key, _Compare, _Allocator>; template <class _InputIterator, class _Allocator, @@ -1390,8 +1387,9 @@ multiset(_InputIterator, _InputIterator, _Allocator) # if _LIBCPP_STD_VER >= 23 template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>> -multiset(from_range_t, _Range&&, _Allocator) - -> multiset<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>; +multiset(from_range_t, + _Range&&, + _Allocator) -> multiset<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>; # endif template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>> |
