Skip to content

Commit 1f98ac0

Browse files
authored
[libc++][NFC] Replace _NOEXCEPT and _LIBCPP_CONSTEXPR macros with the keywords in C++11 code (llvm#96387)
1 parent de0d482 commit 1f98ac0

File tree

23 files changed

+216
-234
lines changed

23 files changed

+216
-234
lines changed

libcxx/include/__atomic/atomic_base.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct __atomic_base // false
3333
mutable __cxx_atomic_impl<_Tp> __a_;
3434

3535
#if _LIBCPP_STD_VER >= 17
36-
static _LIBCPP_CONSTEXPR bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
36+
static constexpr bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
3737
#endif
3838

3939
_LIBCPP_HIDE_FROM_ABI bool is_lock_free() const volatile _NOEXCEPT {
@@ -129,11 +129,6 @@ struct __atomic_base // false
129129
__atomic_base(const __atomic_base&) = delete;
130130
};
131131

132-
#if _LIBCPP_STD_VER >= 17
133-
template <class _Tp, bool __b>
134-
_LIBCPP_CONSTEXPR bool __atomic_base<_Tp, __b>::is_always_lock_free;
135-
#endif
136-
137132
// atomic<Integral>
138133

139134
template <class _Tp>

libcxx/include/__charconv/chars_format.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,17 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator^(chars_format __x,
3939
return chars_format(std::__to_underlying(__x) ^ std::__to_underlying(__y));
4040
}
4141

42-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
43-
operator&=(chars_format& __x, chars_format __y) {
42+
inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format& operator&=(chars_format& __x, chars_format __y) {
4443
__x = __x & __y;
4544
return __x;
4645
}
4746

48-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
49-
operator|=(chars_format& __x, chars_format __y) {
47+
inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format& operator|=(chars_format& __x, chars_format __y) {
5048
__x = __x | __y;
5149
return __x;
5250
}
5351

54-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 chars_format&
55-
operator^=(chars_format& __x, chars_format __y) {
52+
inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format& operator^=(chars_format& __x, chars_format __y) {
5653
__x = __x ^ __y;
5754
return __x;
5855
}

libcxx/include/__chrono/time_point.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,25 +92,22 @@ time_point_cast(const time_point<_Clock, _Duration>& __t) {
9292

9393
#if _LIBCPP_STD_VER >= 17
9494
template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
95-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR time_point<_Clock, _ToDuration>
96-
floor(const time_point<_Clock, _Duration>& __t) {
95+
inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> floor(const time_point<_Clock, _Duration>& __t) {
9796
return time_point<_Clock, _ToDuration>{chrono::floor<_ToDuration>(__t.time_since_epoch())};
9897
}
9998

10099
template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
101-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR time_point<_Clock, _ToDuration>
102-
ceil(const time_point<_Clock, _Duration>& __t) {
100+
inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> ceil(const time_point<_Clock, _Duration>& __t) {
103101
return time_point<_Clock, _ToDuration>{chrono::ceil<_ToDuration>(__t.time_since_epoch())};
104102
}
105103

106104
template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
107-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR time_point<_Clock, _ToDuration>
108-
round(const time_point<_Clock, _Duration>& __t) {
105+
inline _LIBCPP_HIDE_FROM_ABI constexpr time_point<_Clock, _ToDuration> round(const time_point<_Clock, _Duration>& __t) {
109106
return time_point<_Clock, _ToDuration>{chrono::round<_ToDuration>(__t.time_since_epoch())};
110107
}
111108

112109
template <class _Rep, class _Period, enable_if_t<numeric_limits<_Rep>::is_signed, int> = 0>
113-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR duration<_Rep, _Period> abs(duration<_Rep, _Period> __d) {
110+
inline _LIBCPP_HIDE_FROM_ABI constexpr duration<_Rep, _Period> abs(duration<_Rep, _Period> __d) {
114111
return __d >= __d.zero() ? +__d : -__d;
115112
}
116113
#endif // _LIBCPP_STD_VER >= 17

libcxx/include/__functional/function.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ struct __policy {
516516
}
517517

518518
_LIBCPP_HIDE_FROM_ABI static const __policy* __create_empty() {
519-
static const _LIBCPP_CONSTEXPR __policy __policy = {
519+
static constexpr __policy __policy = {
520520
nullptr,
521521
nullptr,
522522
true,
@@ -543,7 +543,7 @@ struct __policy {
543543

544544
template <typename _Fun>
545545
_LIBCPP_HIDE_FROM_ABI static const __policy* __choose_policy(/* is_small = */ false_type) {
546-
static const _LIBCPP_CONSTEXPR __policy __policy = {
546+
static constexpr __policy __policy = {
547547
&__large_clone<_Fun>,
548548
&__large_destroy<_Fun>,
549549
false,
@@ -558,7 +558,7 @@ struct __policy {
558558

559559
template <typename _Fun>
560560
_LIBCPP_HIDE_FROM_ABI static const __policy* __choose_policy(/* is_small = */ true_type) {
561-
static const _LIBCPP_CONSTEXPR __policy __policy = {
561+
static constexpr __policy __policy = {
562562
nullptr,
563563
nullptr,
564564
false,

libcxx/include/__iterator/data.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2323
#if _LIBCPP_STD_VER >= 17
2424

2525
template <class _Cont>
26-
constexpr _LIBCPP_HIDE_FROM_ABI auto data(_Cont& __c) _NOEXCEPT_(noexcept(__c.data())) -> decltype(__c.data()) {
26+
constexpr _LIBCPP_HIDE_FROM_ABI auto data(_Cont& __c) noexcept(noexcept(__c.data())) -> decltype(__c.data()) {
2727
return __c.data();
2828
}
2929

3030
template <class _Cont>
31-
constexpr _LIBCPP_HIDE_FROM_ABI auto data(const _Cont& __c) _NOEXCEPT_(noexcept(__c.data())) -> decltype(__c.data()) {
31+
constexpr _LIBCPP_HIDE_FROM_ABI auto data(const _Cont& __c) noexcept(noexcept(__c.data())) -> decltype(__c.data()) {
3232
return __c.data();
3333
}
3434

libcxx/include/__iterator/size.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2424
#if _LIBCPP_STD_VER >= 17
2525

2626
template <class _Cont>
27-
_LIBCPP_HIDE_FROM_ABI constexpr auto size(const _Cont& __c) _NOEXCEPT_(noexcept(__c.size())) -> decltype(__c.size()) {
27+
_LIBCPP_HIDE_FROM_ABI constexpr auto size(const _Cont& __c) noexcept(noexcept(__c.size())) -> decltype(__c.size()) {
2828
return __c.size();
2929
}
3030

@@ -35,9 +35,9 @@ _LIBCPP_HIDE_FROM_ABI constexpr size_t size(const _Tp (&)[_Sz]) noexcept {
3535

3636
# if _LIBCPP_STD_VER >= 20
3737
template <class _Cont>
38-
_LIBCPP_HIDE_FROM_ABI constexpr auto ssize(const _Cont& __c)
39-
_NOEXCEPT_(noexcept(static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size())))
40-
-> common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>> {
38+
_LIBCPP_HIDE_FROM_ABI constexpr auto
39+
ssize(const _Cont& __c) noexcept(noexcept(static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(
40+
__c.size()))) -> common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>> {
4141
return static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size());
4242
}
4343

libcxx/include/__numeric/gcd_lcm.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct __ct_abs;
3737

3838
template <typename _Result, typename _Source>
3939
struct __ct_abs<_Result, _Source, true> {
40-
_LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI _Result operator()(_Source __t) const noexcept {
40+
constexpr _LIBCPP_HIDE_FROM_ABI _Result operator()(_Source __t) const noexcept {
4141
if (__t >= 0)
4242
return __t;
4343
if (__t == numeric_limits<_Source>::min())
@@ -48,11 +48,11 @@ struct __ct_abs<_Result, _Source, true> {
4848

4949
template <typename _Result, typename _Source>
5050
struct __ct_abs<_Result, _Source, false> {
51-
_LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI _Result operator()(_Source __t) const noexcept { return __t; }
51+
constexpr _LIBCPP_HIDE_FROM_ABI _Result operator()(_Source __t) const noexcept { return __t; }
5252
};
5353

5454
template <class _Tp>
55-
_LIBCPP_CONSTEXPR _LIBCPP_HIDDEN _Tp __gcd(_Tp __a, _Tp __b) {
55+
constexpr _LIBCPP_HIDDEN _Tp __gcd(_Tp __a, _Tp __b) {
5656
static_assert(!is_signed<_Tp>::value, "");
5757

5858
// From: https://lemire.me/blog/2013/12/26/fastest-way-to-compute-the-greatest-common-divisor
@@ -96,7 +96,7 @@ _LIBCPP_CONSTEXPR _LIBCPP_HIDDEN _Tp __gcd(_Tp __a, _Tp __b) {
9696
}
9797

9898
template <class _Tp, class _Up>
99-
_LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up __n) {
99+
constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up __n) {
100100
static_assert(is_integral<_Tp>::value && is_integral<_Up>::value, "Arguments to gcd must be integer types");
101101
static_assert(!is_same<__remove_cv_t<_Tp>, bool>::value, "First argument to gcd cannot be bool");
102102
static_assert(!is_same<__remove_cv_t<_Up>, bool>::value, "Second argument to gcd cannot be bool");
@@ -107,7 +107,7 @@ _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> gcd(_Tp __m, _Up
107107
}
108108

109109
template <class _Tp, class _Up>
110-
_LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> lcm(_Tp __m, _Up __n) {
110+
constexpr _LIBCPP_HIDE_FROM_ABI common_type_t<_Tp, _Up> lcm(_Tp __m, _Up __n) {
111111
static_assert(is_integral<_Tp>::value && is_integral<_Up>::value, "Arguments to lcm must be integer types");
112112
static_assert(!is_same<__remove_cv_t<_Tp>, bool>::value, "First argument to lcm cannot be bool");
113113
static_assert(!is_same<__remove_cv_t<_Up>, bool>::value, "Second argument to lcm cannot be bool");

libcxx/include/__random/discard_block_engine.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class _LIBCPP_TEMPLATE_VIS discard_block_engine {
5050
static const result_type _Min = _Engine::_Min;
5151
static const result_type _Max = _Engine::_Max;
5252
#else
53-
static _LIBCPP_CONSTEXPR const result_type _Min = _Engine::min();
54-
static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max();
53+
static constexpr result_type _Min = _Engine::min();
54+
static constexpr result_type _Max = _Engine::max();
5555
#endif
5656

5757
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Engine::min(); }

libcxx/include/__string/char_traits.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,34 +270,34 @@ struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t> {
270270
static inline _LIBCPP_HIDE_FROM_ABI constexpr bool lt(char_type __c1, char_type __c2) noexcept { return __c1 < __c2; }
271271

272272
static _LIBCPP_HIDE_FROM_ABI constexpr int
273-
compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
273+
compare(const char_type* __s1, const char_type* __s2, size_t __n) noexcept {
274274
return std::__constexpr_memcmp(__s1, __s2, __element_count(__n));
275275
}
276276

277-
static _LIBCPP_HIDE_FROM_ABI constexpr size_t length(const char_type* __str) _NOEXCEPT {
277+
static _LIBCPP_HIDE_FROM_ABI constexpr size_t length(const char_type* __str) noexcept {
278278
return std::__constexpr_strlen(__str);
279279
}
280280

281281
_LIBCPP_HIDE_FROM_ABI static constexpr const char_type*
282-
find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT {
282+
find(const char_type* __s, size_t __n, const char_type& __a) noexcept {
283283
return std::__constexpr_memchr(__s, __a, __n);
284284
}
285285

286286
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type*
287-
move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
287+
move(char_type* __s1, const char_type* __s2, size_t __n) noexcept {
288288
return std::__constexpr_memmove(__s1, __s2, __element_count(__n));
289289
}
290290

291291
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type*
292-
copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
292+
copy(char_type* __s1, const char_type* __s2, size_t __n) noexcept {
293293
_LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(!std::__is_pointer_in_range(__s1, __s1 + __n, __s2),
294294
"char_traits::copy: source and destination ranges overlap");
295295
std::__constexpr_memmove(__s1, __s2, __element_count(__n));
296296
return __s1;
297297
}
298298

299299
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type*
300-
assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT {
300+
assign(char_type* __s, size_t __n, char_type __a) noexcept {
301301
std::fill_n(__s, __n, __a);
302302
return __s;
303303
}

libcxx/include/__utility/pair.h

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,16 @@ struct _LIBCPP_TEMPLATE_VIS pair
135135
typename conditional< _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type;
136136

137137
template <bool _Dummy = true, __enable_if_t<_CheckArgsDep<_Dummy>::__enable_default(), int> = 0>
138-
explicit(!_CheckArgsDep<_Dummy>::__enable_implicit_default()) _LIBCPP_HIDE_FROM_ABI
139-
_LIBCPP_CONSTEXPR pair() _NOEXCEPT_(
140-
is_nothrow_default_constructible<first_type>::value&& is_nothrow_default_constructible<second_type>::value)
138+
explicit(!_CheckArgsDep<_Dummy>::__enable_implicit_default()) _LIBCPP_HIDE_FROM_ABI constexpr pair() noexcept(
139+
is_nothrow_default_constructible<first_type>::value && is_nothrow_default_constructible<second_type>::value)
141140
: first(), second() {}
142141

143142
template <bool _Dummy = true,
144143
__enable_if_t<_CheckArgsDep<_Dummy>::template __is_pair_constructible<_T1 const&, _T2 const&>(), int> = 0>
145-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(
146-
!_CheckArgsDep<_Dummy>::template __is_implicit<_T1 const&, _T2 const&>()) pair(_T1 const& __t1, _T2 const& __t2)
147-
_NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value&& is_nothrow_copy_constructible<second_type>::value)
144+
_LIBCPP_HIDE_FROM_ABI
145+
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgsDep<_Dummy>::template __is_implicit<_T1 const&, _T2 const&>())
146+
pair(_T1 const& __t1, _T2 const& __t2) noexcept(is_nothrow_copy_constructible<first_type>::value &&
147+
is_nothrow_copy_constructible<second_type>::value)
148148
: first(__t1), second(__t2) {}
149149

150150
template <
@@ -156,10 +156,9 @@ struct _LIBCPP_TEMPLATE_VIS pair
156156
class _U2,
157157
# endif
158158
__enable_if_t<_CheckArgs::template __is_pair_constructible<_U1, _U2>(), int> = 0 >
159-
_LIBCPP_HIDE_FROM_ABI
160-
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>()) pair(_U1&& __u1, _U2&& __u2)
161-
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
162-
is_nothrow_constructible<second_type, _U2>::value))
159+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>())
160+
pair(_U1&& __u1, _U2&& __u2) noexcept(is_nothrow_constructible<first_type, _U1>::value &&
161+
is_nothrow_constructible<second_type, _U2>::value)
163162
: first(std::forward<_U1>(__u1)), second(std::forward<_U2>(__u2)) {
164163
}
165164

@@ -176,16 +175,14 @@ struct _LIBCPP_TEMPLATE_VIS pair
176175
__enable_if_t<_CheckArgs::template __is_pair_constructible<_U1 const&, _U2 const&>(), int> = 0>
177176
_LIBCPP_HIDE_FROM_ABI
178177
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1 const&, _U2 const&>())
179-
pair(pair<_U1, _U2> const& __p)
180-
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
181-
is_nothrow_constructible<second_type, _U2 const&>::value))
178+
pair(pair<_U1, _U2> const& __p) noexcept(is_nothrow_constructible<first_type, _U1 const&>::value &&
179+
is_nothrow_constructible<second_type, _U2 const&>::value)
182180
: first(__p.first), second(__p.second) {}
183181

184182
template <class _U1, class _U2, __enable_if_t<_CheckArgs::template __is_pair_constructible<_U1, _U2>(), int> = 0>
185-
_LIBCPP_HIDE_FROM_ABI
186-
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>()) pair(pair<_U1, _U2>&& __p)
187-
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
188-
is_nothrow_constructible<second_type, _U2&&>::value))
183+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>())
184+
pair(pair<_U1, _U2>&& __p) noexcept(is_nothrow_constructible<first_type, _U1&&>::value &&
185+
is_nothrow_constructible<second_type, _U2&&>::value)
189186
: first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) {}
190187

191188
# if _LIBCPP_STD_VER >= 23
@@ -219,28 +216,28 @@ struct _LIBCPP_TEMPLATE_VIS pair
219216

220217
template <class... _Args1, class... _Args2>
221218
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
222-
pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args, tuple<_Args2...> __second_args) _NOEXCEPT_(
223-
is_nothrow_constructible<first_type, _Args1...>::value&& is_nothrow_constructible<second_type, _Args2...>::value)
219+
pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args, tuple<_Args2...> __second_args) noexcept(
220+
is_nothrow_constructible<first_type, _Args1...>::value && is_nothrow_constructible<second_type, _Args2...>::value)
224221
: pair(__pc,
225222
__first_args,
226223
__second_args,
227224
typename __make_tuple_indices<sizeof...(_Args1)>::type(),
228225
typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
229226

230227
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair&
231-
operator=(__conditional_t< is_copy_assignable<first_type>::value && is_copy_assignable<second_type>::value,
232-
pair,
233-
__nat> const& __p)
234-
_NOEXCEPT_(is_nothrow_copy_assignable<first_type>::value&& is_nothrow_copy_assignable<second_type>::value) {
228+
operator=(__conditional_t<is_copy_assignable<first_type>::value && is_copy_assignable<second_type>::value,
229+
pair,
230+
__nat> const& __p) noexcept(is_nothrow_copy_assignable<first_type>::value &&
231+
is_nothrow_copy_assignable<second_type>::value) {
235232
first = __p.first;
236233
second = __p.second;
237234
return *this;
238235
}
239236

240237
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair& operator=(
241-
__conditional_t< is_move_assignable<first_type>::value && is_move_assignable<second_type>::value, pair, __nat>&&
242-
__p)
243-
_NOEXCEPT_(is_nothrow_move_assignable<first_type>::value&& is_nothrow_move_assignable<second_type>::value) {
238+
__conditional_t<is_move_assignable<first_type>::value && is_move_assignable<second_type>::value, pair, __nat>&&
239+
__p) noexcept(is_nothrow_move_assignable<first_type>::value &&
240+
is_nothrow_move_assignable<second_type>::value) {
244241
first = std::forward<first_type>(__p.first);
245242
second = std::forward<second_type>(__p.second);
246243
return *this;

libcxx/include/deque

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,11 @@ public:
632632
return *this;
633633
}
634634

635-
_LIBCPP_HIDE_FROM_ABI deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
635+
_LIBCPP_HIDE_FROM_ABI deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value);
636636
_LIBCPP_HIDE_FROM_ABI deque(deque&& __c, const __type_identity_t<allocator_type>& __a);
637-
_LIBCPP_HIDE_FROM_ABI deque& operator=(deque&& __c)
638-
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value&&
639-
is_nothrow_move_assignable<allocator_type>::value);
637+
_LIBCPP_HIDE_FROM_ABI deque&
638+
operator=(deque&& __c) noexcept(__alloc_traits::propagate_on_container_move_assignment::value &&
639+
is_nothrow_move_assignable<allocator_type>::value);
640640

641641
_LIBCPP_HIDE_FROM_ABI void assign(initializer_list<value_type> __il) { assign(__il.begin(), __il.end()); }
642642
#endif // _LIBCPP_CXX03_LANG
@@ -1309,7 +1309,7 @@ deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il, const allocator
13091309
}
13101310

13111311
template <class _Tp, class _Allocator>
1312-
inline deque<_Tp, _Allocator>::deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
1312+
inline deque<_Tp, _Allocator>::deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value)
13131313
: __map_(std::move(__c.__map_)), __start_(std::move(__c.__start_)), __size_(std::move(__c.__size_)) {
13141314
__c.__start_ = 0;
13151315
__c.__size() = 0;
@@ -1333,8 +1333,9 @@ inline deque<_Tp, _Allocator>::deque(deque&& __c, const __type_identity_t<alloca
13331333
}
13341334

13351335
template <class _Tp, class _Allocator>
1336-
inline deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(deque&& __c) _NOEXCEPT_(
1337-
__alloc_traits::propagate_on_container_move_assignment::value&& is_nothrow_move_assignable<allocator_type>::value) {
1336+
inline deque<_Tp, _Allocator>& deque<_Tp, _Allocator>::operator=(deque&& __c) noexcept(
1337+
__alloc_traits::propagate_on_container_move_assignment::value &&
1338+
is_nothrow_move_assignable<allocator_type>::value) {
13381339
__move_assign(__c, integral_constant<bool, __alloc_traits::propagate_on_container_move_assignment::value>());
13391340
return *this;
13401341
}
@@ -1349,8 +1350,8 @@ void deque<_Tp, _Allocator>::__move_assign(deque& __c, false_type) {
13491350
}
13501351

13511352
template <class _Tp, class _Allocator>
1352-
void deque<_Tp, _Allocator>::__move_assign(deque& __c, true_type)
1353-
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
1353+
void deque<_Tp, _Allocator>::__move_assign(deque& __c,
1354+
true_type) noexcept(is_nothrow_move_assignable<allocator_type>::value) {
13541355
clear();
13551356
shrink_to_fit();
13561357
__move_assign(__c);

0 commit comments

Comments
 (0)