Skip to content

Commit 7521604

Browse files
committed
[libc++] Simplify a bunch of noexcept specifications
1 parent 0b52b82 commit 7521604

File tree

19 files changed

+140
-510
lines changed

19 files changed

+140
-510
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_replaceable.h>
3432
#include <__type_traits/is_swappable.h>
3533
#include <__type_traits/is_trivially_destructible.h>
@@ -185,8 +183,7 @@ public:
185183
}
186184

187185
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
188-
__copy_without_alloc(__split_buffer_pointer_layout const& __other)
189-
_NOEXCEPT_(is_nothrow_copy_assignable<pointer>::value) {
186+
__copy_without_alloc(__split_buffer_pointer_layout const& __other) _NOEXCEPT {
190187
__front_cap_ = __other.__front_cap_;
191188
__begin_ = __other.__begin_;
192189
__end_ = __other.__end_;
@@ -342,8 +339,7 @@ public:
342339
}
343340

344341
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
345-
__copy_without_alloc(__split_buffer_size_layout const& __other)
346-
_NOEXCEPT_(is_nothrow_copy_assignable<pointer>::value) {
342+
__copy_without_alloc(__split_buffer_size_layout const& __other) _NOEXCEPT {
347343
__front_cap_ = __other.__front_cap_;
348344
__begin_ = __other.__begin_;
349345
__cap_ = __other.__cap_;
@@ -502,15 +498,11 @@ public:
502498
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
503499
__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
504500

505-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c)
506-
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
501+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c) _NOEXCEPT;
507502

508503
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
509504

510-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator=(__split_buffer&& __c)
511-
_NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
512-
is_nothrow_move_assignable<allocator_type>::value) ||
513-
!__alloc_traits::propagate_on_container_move_assignment::value);
505+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator=(__split_buffer&& __c) _NOEXCEPT;
514506

515507
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~__split_buffer();
516508

@@ -564,8 +556,7 @@ public:
564556
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
565557
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
566558

567-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x)
568-
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr>);
559+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x) _NOEXCEPT;
569560

570561
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const {
571562
if (__front_cap() == nullptr) {
@@ -599,8 +590,8 @@ public:
599590
}
600591

601592
private:
602-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer& __c, true_type)
603-
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
593+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
594+
__move_assign_alloc(__split_buffer& __c, true_type) _NOEXCEPT {
604595
__get_allocator() = std::move(__c.__get_allocator());
605596
}
606597

@@ -745,8 +736,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>::~__split
745736
}
746737

747738
template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
748-
_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(__split_buffer&& __c)
749-
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
739+
_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(__split_buffer&& __c) _NOEXCEPT
750740
: __base_type(std::move(__c)) {
751741
__c.__reset();
752742
}
@@ -772,10 +762,7 @@ __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(__split_buffer&& __c, c
772762

773763
template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
774764
_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>&
775-
__split_buffer<_Tp, _Allocator, _Layout>::operator=(__split_buffer&& __c)
776-
_NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
777-
is_nothrow_move_assignable<allocator_type>::value) ||
778-
!__alloc_traits::propagate_on_container_move_assignment::value) {
765+
__split_buffer<_Tp, _Allocator, _Layout>::operator=(__split_buffer&& __c) _NOEXCEPT {
779766
clear();
780767
shrink_to_fit();
781768
__copy_without_alloc(__c);
@@ -785,8 +772,7 @@ __split_buffer<_Tp, _Allocator, _Layout>::operator=(__split_buffer&& __c)
785772
}
786773

787774
template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
788-
_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::swap(__split_buffer& __x)
789-
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr>) {
775+
_LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::swap(__split_buffer& __x) _NOEXCEPT {
790776
__base_type::swap(__x);
791777
}
792778

@@ -857,8 +843,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator, _Layout>::emp
857843

858844
template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
859845
_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void
860-
swap(__split_buffer<_Tp, _Allocator, _Layout>& __x, __split_buffer<_Tp, _Allocator, _Layout>& __y)
861-
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
846+
swap(__split_buffer<_Tp, _Allocator, _Layout>& __x, __split_buffer<_Tp, _Allocator, _Layout>& __y) _NOEXCEPT {
862847
__x.swap(__y);
863848
}
864849

libcxx/include/__tree

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -892,14 +892,12 @@ public:
892892
_LIBCPP_HIDE_FROM_ABI void __assign_unique(_ForwardIterator __first, _ForwardIterator __last);
893893
template <class _InputIterator>
894894
_LIBCPP_HIDE_FROM_ABI void __assign_multi(_InputIterator __first, _InputIterator __last);
895-
_LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t) _NOEXCEPT_(
896-
is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<value_compare>::value);
895+
_LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t) _NOEXCEPT_(is_nothrow_move_constructible<value_compare>::value);
897896
_LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t, const allocator_type& __a);
898897

899898
_LIBCPP_HIDE_FROM_ABI __tree& operator=(__tree&& __t)
900899
_NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&
901-
((__node_traits::propagate_on_container_move_assignment::value &&
902-
is_nothrow_move_assignable<__node_allocator>::value) ||
900+
(__node_traits::propagate_on_container_move_assignment::value ||
903901
allocator_traits<__node_allocator>::is_always_equal::value)) {
904902
__move_assign(__t, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());
905903
return *this;
@@ -921,13 +919,7 @@ public:
921919

922920
_LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
923921

924-
_LIBCPP_HIDE_FROM_ABI void swap(__tree& __t)
925-
#if _LIBCPP_STD_VER <= 11
926-
_NOEXCEPT_(__is_nothrow_swappable_v<value_compare> &&
927-
(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>));
928-
#else
929-
_NOEXCEPT_(__is_nothrow_swappable_v<value_compare>);
930-
#endif
922+
_LIBCPP_HIDE_FROM_ABI void swap(__tree& __t) _NOEXCEPT_(__is_nothrow_swappable_v<value_compare>);
931923

932924
template <class... _Args>
933925
_LIBCPP_HIDE_FROM_ABI iterator __emplace_multi(_Args&&... __args);
@@ -1290,17 +1282,14 @@ private:
12901282
_LIBCPP_HIDDEN void destroy(__node_pointer __nd) _NOEXCEPT { (__tree_deleter(__node_alloc_))(__nd); }
12911283

12921284
_LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, false_type);
1293-
_LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, true_type) _NOEXCEPT_(
1294-
is_nothrow_move_assignable<value_compare>::value&& is_nothrow_move_assignable<__node_allocator>::value);
1285+
_LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, true_type)
1286+
_NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value);
12951287

1296-
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree& __t)
1297-
_NOEXCEPT_(!__node_traits::propagate_on_container_move_assignment::value ||
1298-
is_nothrow_move_assignable<__node_allocator>::value) {
1288+
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree& __t) _NOEXCEPT {
12991289
__move_assign_alloc(__t, integral_constant<bool, __node_traits::propagate_on_container_move_assignment::value>());
13001290
}
13011291

1302-
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree& __t, true_type)
1303-
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value) {
1292+
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree& __t, true_type) _NOEXCEPT {
13041293
__node_alloc() = std::move(__t.__node_alloc());
13051294
}
13061295
_LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {}
@@ -1575,8 +1564,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
15751564
}
15761565

15771566
template <class _Tp, class _Compare, class _Allocator>
1578-
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(
1579-
is_nothrow_move_constructible<__node_allocator>::value&& is_nothrow_move_constructible<value_compare>::value)
1567+
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) _NOEXCEPT_(is_nothrow_move_constructible<value_compare>::value)
15801568
: __begin_node_(std::move(__t.__begin_node_)),
15811569
__end_node_(std::move(__t.__end_node_)),
15821570
__node_alloc_(std::move(__t.__node_alloc_)),
@@ -1614,7 +1602,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __
16141602

16151603
template <class _Tp, class _Compare, class _Allocator>
16161604
void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)
1617-
_NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value&& is_nothrow_move_assignable<__node_allocator>::value) {
1605+
_NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value) {
16181606
destroy(static_cast<__node_pointer>(__end_node()->__left_));
16191607
__begin_node_ = __t.__begin_node_;
16201608
__end_node_ = __t.__end_node_;
@@ -1653,14 +1641,7 @@ void __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type) {
16531641
}
16541642

16551643
template <class _Tp, class _Compare, class _Allocator>
1656-
void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
1657-
#if _LIBCPP_STD_VER <= 11
1658-
_NOEXCEPT_(__is_nothrow_swappable_v<value_compare> &&
1659-
(!__node_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__node_allocator>))
1660-
#else
1661-
_NOEXCEPT_(__is_nothrow_swappable_v<value_compare>)
1662-
#endif
1663-
{
1644+
void __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t) _NOEXCEPT_(__is_nothrow_swappable_v<value_compare>) {
16641645
using std::swap;
16651646
swap(__begin_node_, __t.__begin_node_);
16661647
swap(__end_node_, __t.__end_node_);

0 commit comments

Comments
 (0)