Skip to content

Commit 3d12d11

Browse files
committed
[libc++] Simplify a bunch of noexcept specifications
1 parent 09fd430 commit 3d12d11

File tree

21 files changed

+172
-569
lines changed

21 files changed

+172
-569
lines changed

libcxx/include/__hash_table

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -518,13 +518,13 @@ public:
518518
_LIBCPP_HIDE_FROM_ABI __bucket_list_deallocator() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
519519
: __size_(0) {}
520520

521-
_LIBCPP_HIDE_FROM_ABI __bucket_list_deallocator(const allocator_type& __a, size_type __size)
522-
_NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
523-
: __size_(__size), __alloc_(__a) {}
521+
_LIBCPP_HIDE_FROM_ABI __bucket_list_deallocator(const allocator_type& __a, size_type __size) _NOEXCEPT
522+
: __size_(__size),
523+
__alloc_(__a) {}
524524

525-
_LIBCPP_HIDE_FROM_ABI __bucket_list_deallocator(__bucket_list_deallocator&& __x)
526-
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
527-
: __size_(std::move(__x.__size_)), __alloc_(std::move(__x.__alloc_)) {
525+
_LIBCPP_HIDE_FROM_ABI __bucket_list_deallocator(__bucket_list_deallocator&& __x) _NOEXCEPT
526+
: __size_(std::move(__x.__size_)),
527+
__alloc_(std::move(__x.__alloc_)) {
528528
__x.size() = 0;
529529
}
530530

@@ -740,16 +740,14 @@ public:
740740
_LIBCPP_HIDE_FROM_ABI __hash_table(const __hash_table& __u, const allocator_type& __a);
741741
_LIBCPP_HIDE_FROM_ABI __hash_table(__hash_table&& __u) _NOEXCEPT_(
742742
is_nothrow_move_constructible<__bucket_list>::value&& is_nothrow_move_constructible<__first_node>::value&&
743-
is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<hasher>::value&&
744-
is_nothrow_move_constructible<key_equal>::value);
743+
is_nothrow_move_constructible<hasher>::value&& is_nothrow_move_constructible<key_equal>::value);
745744
_LIBCPP_HIDE_FROM_ABI __hash_table(__hash_table&& __u, const allocator_type& __a);
746745
_LIBCPP_HIDE_FROM_ABI ~__hash_table();
747746

748747
_LIBCPP_HIDE_FROM_ABI __hash_table& operator=(const __hash_table& __u);
749748
_LIBCPP_HIDE_FROM_ABI __hash_table& operator=(__hash_table&& __u)
750749
_NOEXCEPT_(is_nothrow_move_assignable<hasher>::value&& is_nothrow_move_assignable<key_equal>::value &&
751-
((__node_traits::propagate_on_container_move_assignment::value &&
752-
is_nothrow_move_assignable<__node_allocator>::value) ||
750+
(__node_traits::propagate_on_container_move_assignment::value ||
753751
allocator_traits<__node_allocator>::is_always_equal::value));
754752
template <class _InputIterator>
755753
_LIBCPP_HIDE_FROM_ABI void __assign_unique(_InputIterator __first, _InputIterator __last);
@@ -944,14 +942,7 @@ public:
944942
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> __equal_range_multi(const _Key& __k) const;
945943

946944
_LIBCPP_HIDE_FROM_ABI void swap(__hash_table& __u)
947-
#if _LIBCPP_STD_VER <= 11
948-
_NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal> &&
949-
(!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value ||
950-
__is_nothrow_swappable_v<__pointer_allocator>) &&
951-
(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>));
952-
#else
953945
_NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal>);
954-
#endif
955946

956947
_LIBCPP_HIDE_FROM_ABI size_type max_bucket_count() const _NOEXCEPT { return max_size(); }
957948
_LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const;
@@ -1011,15 +1002,11 @@ private:
10111002

10121003
_LIBCPP_HIDE_FROM_ABI void __move_assign(__hash_table& __u, false_type);
10131004
_LIBCPP_HIDE_FROM_ABI void __move_assign(__hash_table& __u, true_type)
1014-
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value&& is_nothrow_move_assignable<hasher>::value&&
1015-
is_nothrow_move_assignable<key_equal>::value);
1016-
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__hash_table& __u) _NOEXCEPT_(
1017-
!__node_traits::propagate_on_container_move_assignment::value ||
1018-
(is_nothrow_move_assignable<__pointer_allocator>::value && is_nothrow_move_assignable<__node_allocator>::value)) {
1005+
_NOEXCEPT_(is_nothrow_move_assignable<hasher>::value&& is_nothrow_move_assignable<key_equal>::value);
1006+
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__hash_table& __u) _NOEXCEPT {
10191007
__move_assign_alloc(__u, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());
10201008
}
1021-
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__hash_table& __u, true_type) _NOEXCEPT_(
1022-
is_nothrow_move_assignable<__pointer_allocator>::value&& is_nothrow_move_assignable<__node_allocator>::value) {
1009+
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__hash_table& __u, true_type) _NOEXCEPT {
10231010
__bucket_list_.get_deleter().__alloc() = std::move(__u.__bucket_list_.get_deleter().__alloc());
10241011
__node_alloc() = std::move(__u.__node_alloc());
10251012
}
@@ -1132,8 +1119,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u,
11321119
template <class _Tp, class _Hash, class _Equal, class _Alloc>
11331120
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u) _NOEXCEPT_(
11341121
is_nothrow_move_constructible<__bucket_list>::value&& is_nothrow_move_constructible<__first_node>::value&&
1135-
is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<hasher>::value&&
1136-
is_nothrow_move_constructible<key_equal>::value)
1122+
is_nothrow_move_constructible<hasher>::value&& is_nothrow_move_constructible<key_equal>::value)
11371123
: __bucket_list_(std::move(__u.__bucket_list_)),
11381124
__first_node_(std::move(__u.__first_node_)),
11391125
__node_alloc_(std::move(__u.__node_alloc_)),
@@ -1278,8 +1264,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__detach() _NOEXCEPT {
12781264

12791265
template <class _Tp, class _Hash, class _Equal, class _Alloc>
12801266
void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(__hash_table& __u, true_type)
1281-
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value&& is_nothrow_move_assignable<hasher>::value&&
1282-
is_nothrow_move_assignable<key_equal>::value) {
1267+
_NOEXCEPT_(is_nothrow_move_assignable<hasher>::value&& is_nothrow_move_assignable<key_equal>::value) {
12831268
clear();
12841269
__bucket_list_.reset(__u.__bucket_list_.release());
12851270
__bucket_list_.get_deleter().size() = __u.__bucket_list_.get_deleter().size();
@@ -1325,8 +1310,7 @@ void __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(__hash_table& __u,
13251310
template <class _Tp, class _Hash, class _Equal, class _Alloc>
13261311
inline __hash_table<_Tp, _Hash, _Equal, _Alloc>& __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(__hash_table&& __u)
13271312
_NOEXCEPT_(is_nothrow_move_assignable<hasher>::value&& is_nothrow_move_assignable<key_equal>::value &&
1328-
((__node_traits::propagate_on_container_move_assignment::value &&
1329-
is_nothrow_move_assignable<__node_allocator>::value) ||
1313+
(__node_traits::propagate_on_container_move_assignment::value ||
13301314
allocator_traits<__node_allocator>::is_always_equal::value)) {
13311315
__move_assign(__u, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());
13321316
return *this;
@@ -2058,15 +2042,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__equal_range_multi(const _Key& __k) c
20582042

20592043
template <class _Tp, class _Hash, class _Equal, class _Alloc>
20602044
void __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
2061-
#if _LIBCPP_STD_VER <= 11
2062-
_NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal> &&
2063-
(!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value ||
2064-
__is_nothrow_swappable_v<__pointer_allocator>) &&
2065-
(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>))
2066-
#else
2067-
_NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal>)
2068-
#endif
2069-
{
2045+
_NOEXCEPT_(__is_nothrow_swappable_v<hasher>&& __is_nothrow_swappable_v<key_equal>) {
20702046
_LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(
20712047
__node_traits::propagate_on_container_swap::value || this->__node_alloc() == __u.__node_alloc(),
20722048
"unordered container::swap: Either propagate_on_container_swap "

libcxx/include/__memory/noexcept_move_assign_container.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <__config>
1313
#include <__memory/allocator_traits.h>
1414
#include <__type_traits/integral_constant.h>
15-
#include <__type_traits/is_nothrow_assignable.h>
1615

1716
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1817
# pragma GCC system_header
@@ -26,8 +25,6 @@ struct __noexcept_move_assign_container
2625
_Traits::propagate_on_container_move_assignment::value
2726
#if _LIBCPP_STD_VER >= 17
2827
|| _Traits::is_always_equal::value
29-
#else
30-
&& is_nothrow_move_assignable<_Alloc>::value
3128
#endif
3229
> {
3330
};

libcxx/include/__split_buffer

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include <__type_traits/conditional.h>
2929
#include <__type_traits/enable_if.h>
3030
#include <__type_traits/integral_constant.h>
31-
#include <__type_traits/is_nothrow_assignable.h>
32-
#include <__type_traits/is_nothrow_constructible.h>
3331
#include <__type_traits/is_swappable.h>
3432
#include <__type_traits/is_trivially_destructible.h>
3533
#include <__type_traits/is_trivially_relocatable.h>
@@ -184,8 +182,7 @@ public:
184182
}
185183

186184
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
187-
__copy_without_alloc(__split_buffer_pointer_layout const& __other)
188-
_NOEXCEPT_(is_nothrow_copy_assignable<pointer>::value) {
185+
__copy_without_alloc(__split_buffer_pointer_layout const& __other) _NOEXCEPT {
189186
__front_cap_ = __other.__front_cap_;
190187
__begin_ = __other.__begin_;
191188
__end_ = __other.__end_;
@@ -341,8 +338,7 @@ public:
341338
}
342339

343340
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
344-
__copy_without_alloc(__split_buffer_size_layout const& __other)
345-
_NOEXCEPT_(is_nothrow_copy_assignable<pointer>::value) {
341+
__copy_without_alloc(__split_buffer_size_layout const& __other) _NOEXCEPT {
346342
__front_cap_ = __other.__front_cap_;
347343
__begin_ = __other.__begin_;
348344
__cap_ = __other.__cap_;
@@ -497,15 +493,11 @@ public:
497493
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
498494
__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
499495

500-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c)
501-
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
496+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c) _NOEXCEPT;
502497

503498
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
504499

505-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator=(__split_buffer&& __c)
506-
_NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
507-
is_nothrow_move_assignable<allocator_type>::value) ||
508-
!__alloc_traits::propagate_on_container_move_assignment::value);
500+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator=(__split_buffer&& __c) _NOEXCEPT;
509501

510502
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~__split_buffer();
511503

@@ -559,8 +551,7 @@ public:
559551
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
560552
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
561553

562-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x)
563-
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr>);
554+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x) _NOEXCEPT;
564555

565556
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const {
566557
if (__front_cap() == nullptr) {
@@ -594,8 +585,8 @@ public:
594585
}
595586

596587
private:
597-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer& __c, true_type)
598-
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
588+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
589+
__move_assign_alloc(__split_buffer& __c, true_type) _NOEXCEPT {
599590
__get_allocator() = std::move(__c.__get_allocator());
600591
}
601592

@@ -740,8 +731,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>::~__split
740731
}
741732

742733
template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
743-
_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(__split_buffer&& __c)
744-
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
734+
_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(__split_buffer&& __c) _NOEXCEPT
745735
: __base_type(std::move(__c)) {
746736
__c.__reset();
747737
}
@@ -767,10 +757,7 @@ __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(__split_buffer&& __c, c
767757

768758
template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
769759
_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>&
770-
__split_buffer<_Tp, _Allocator, _Layout>::operator=(__split_buffer&& __c)
771-
_NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
772-
is_nothrow_move_assignable<allocator_type>::value) ||
773-
!__alloc_traits::propagate_on_container_move_assignment::value) {
760+
__split_buffer<_Tp, _Allocator, _Layout>::operator=(__split_buffer&& __c) _NOEXCEPT {
774761
clear();
775762
shrink_to_fit();
776763
__copy_without_alloc(__c);
@@ -780,8 +767,7 @@ __split_buffer<_Tp, _Allocator, _Layout>::operator=(__split_buffer&& __c)
780767
}
781768

782769
template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
783-
_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::swap(__split_buffer& __x)
784-
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr>) {
770+
_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::swap(__split_buffer& __x) _NOEXCEPT {
785771
__base_type::swap(__x);
786772
}
787773

@@ -852,8 +838,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
852838

853839
template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
854840
_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void
855-
swap(__split_buffer<_Tp, _Allocator, _Layout>& __x, __split_buffer<_Tp, _Allocator, _Layout>& __y)
856-
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
841+
swap(__split_buffer<_Tp, _Allocator, _Layout>& __x, __split_buffer<_Tp, _Allocator, _Layout>& __y) _NOEXCEPT {
857842
__x.swap(__y);
858843
}
859844

libcxx/include/__tree

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -904,14 +904,12 @@ public:
904904
_LIBCPP_HIDE_FROM_ABI void __assign_unique(_ForwardIterator __first, _ForwardIterator __last);
905905
template <class _InputIterator>
906906
_LIBCPP_HIDE_FROM_ABI void __assign_multi(_InputIterator __first, _InputIterator __last);
907-
_LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t) _NOEXCEPT_(
908-
is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<value_compare>::value);
907+
_LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t) _NOEXCEPT_(is_nothrow_move_constructible<value_compare>::value);
909908
_LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t, const allocator_type& __a);
910909

911910
_LIBCPP_HIDE_FROM_ABI __tree& operator=(__tree&& __t)
912911
_NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&
913-
((__node_traits::propagate_on_container_move_assignment::value &&
914-
is_nothrow_move_assignable<__node_allocator>::value) ||
912+
(__node_traits::propagate_on_container_move_assignment::value ||
915913
allocator_traits<__node_allocator>::is_always_equal::value)) {
916914
__move_assign(__t, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());
917915
return *this;
@@ -933,13 +931,7 @@ public:
933931

934932
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
935933

936-
_LIBCPP_HIDE_FROM_ABI void swap(__tree& __t)
937-
#if _LIBCPP_STD_VER <= 11
938-
_NOEXCEPT_(__is_nothrow_swappable_v<value_compare> &&
939-
(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>));
940-
#else
941-
_NOEXCEPT_(__is_nothrow_swappable_v<value_compare>);
942-
#endif
934+
_LIBCPP_HIDE_FROM_ABI void swap(__tree& __t) _NOEXCEPT_(__is_nothrow_swappable_v<value_compare>);
943935

944936
template <class... _Args>
945937
_LIBCPP_HIDE_FROM_ABI iterator __emplace_multi(_Args&&... __args);
@@ -1281,17 +1273,14 @@ private:
12811273
_LIBCPP_HIDDEN void destroy(__node_pointer __nd) _NOEXCEPT { (__tree_deleter(__node_alloc_))(__nd); }
12821274

12831275
_LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, false_type);
1284-
_LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, true_type) _NOEXCEPT_(
1285-
is_nothrow_move_assignable<value_compare>::value&& is_nothrow_move_assignable<__node_allocator>::value);
1276+
_LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, true_type)
1277+
_NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value);
12861278

1287-
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree& __t)
1288-
_NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value ||
1289-
is_nothrow_move_assignable<__node_allocator>::value) {
1279+
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree& __t) _NOEXCEPT {
12901280
__move_assign_alloc(__t, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());
12911281
}
12921282

1293-
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree& __t, true_type)
1294-
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value) {
1283+
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree& __t, true_type) _NOEXCEPT {
12951284
__node_alloc() = std::move(__t.__node_alloc());
12961285
}
12971286
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {}
@@ -1605,8 +1594,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
16051594
}
16061595

16071596
template <class _Tp, class _Compare, class _Allocator>
1608-
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(
1609-
is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<value_compare>::value)
1597+
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(is_nothrow_move_constructible<value_compare>::value)
16101598
: __begin_node_(std::move(__t.__begin_node_)),
16111599
__end_node_(std::move(__t.__end_node_)),
16121600
__node_alloc_(std::move(__t.__node_alloc_)),
@@ -1649,7 +1637,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __
16491637

16501638
template <class _Tp, class _Compare, class _Allocator>
16511639
void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)
1652-
_NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value&& is_nothrow_move_assignable<__node_allocator>::value) {
1640+
_NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value) {
16531641
destroy(static_cast<__node_pointer>(__end_node()->__left_));
16541642
__begin_node_ = __t.__begin_node_;
16551643
__end_node_ = __t.__end_node_;
@@ -1687,14 +1675,7 @@ void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type) {
16871675
}
16881676

16891677
template <class _Tp, class _Compare, class _Allocator>
1690-
void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
1691-
#if _LIBCPP_STD_VER <= 11
1692-
_NOEXCEPT_(__is_nothrow_swappable_v<value_compare> &&
1693-
(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>))
1694-
#else
1695-
_NOEXCEPT_(__is_nothrow_swappable_v<value_compare>)
1696-
#endif
1697-
{
1678+
void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t) _NOEXCEPT_(__is_nothrow_swappable_v<value_compare>) {
16981679
using std::swap;
16991680
swap(__begin_node_, __t.__begin_node_);
17001681
swap(__end_node_, __t.__end_node_);

0 commit comments

Comments
 (0)