@@ -261,8 +261,8 @@ struct pair { // store a pair of values
261
261
pair(pair&&) = default;
262
262
263
263
#if _HAS_CXX23
264
- template <class _Other1, class _Other2,
265
- enable_if_t<conjunction_v<is_constructible< _Ty1, _Other1&>, is_constructible <_Ty2, _Other2&>>, int> = 0 >
264
+ template <class _Other1, class _Other2>
265
+ requires is_constructible_v< _Ty1, _Other1&> && is_constructible_v <_Ty2, _Other2&>
266
266
constexpr explicit(!conjunction_v<is_convertible<_Other1&, _Ty1>, is_convertible<_Other2&, _Ty2>>)
267
267
pair(pair<_Other1, _Other2>& _Right) noexcept(
268
268
is_nothrow_constructible_v<_Ty1, _Other1&> && is_nothrow_constructible_v<_Ty2, _Other2&>) // strengthened
@@ -286,9 +286,8 @@ struct pair { // store a pair of values
286
286
: first(_STD forward<_Other1>(_Right.first)), second(_STD forward<_Other2>(_Right.second)) {}
287
287
288
288
#if _HAS_CXX23
289
- template <class _Other1, class _Other2,
290
- enable_if_t<conjunction_v<is_constructible<_Ty1, const _Other1>, is_constructible<_Ty2, const _Other2>>, int> =
291
- 0>
289
+ template <class _Other1, class _Other2>
290
+ requires is_constructible_v<_Ty1, const _Other1> && is_constructible_v<_Ty2, const _Other2>
292
291
constexpr explicit(!conjunction_v<is_convertible<const _Other1, _Ty1>, is_convertible<const _Other2, _Ty2>>)
293
292
pair(const pair<_Other1, _Other2>&& _Right) noexcept(
294
293
is_nothrow_constructible_v<_Ty1, const _Other1>
@@ -335,10 +334,9 @@ struct pair { // store a pair of values
335
334
}
336
335
337
336
#if _HAS_CXX23
338
- template <class _Myself = pair,
339
- enable_if_t<conjunction_v<_Is_copy_assignable_no_precondition_check<const typename _Myself::first_type>,
340
- _Is_copy_assignable_no_precondition_check<const typename _Myself::second_type>>,
341
- int> = 0>
337
+ template <class _Myself = pair>
338
+ requires _Is_copy_assignable_unchecked_v<const typename _Myself::first_type>
339
+ && _Is_copy_assignable_unchecked_v<const typename _Myself::second_type>
342
340
constexpr const pair& operator=(_Identity_t<const _Myself&> _Right) const
343
341
noexcept(conjunction_v<is_nothrow_copy_assignable<const _Ty1>,
344
342
is_nothrow_copy_assignable<const _Ty2>>) /* strengthened */ {
@@ -360,10 +358,9 @@ struct pair { // store a pair of values
360
358
}
361
359
362
360
#if _HAS_CXX23
363
- template <class _Myself = pair,
364
- enable_if_t<conjunction_v<_Is_assignable_no_precondition_check<const typename _Myself::first_type&, _Ty1>,
365
- _Is_assignable_no_precondition_check<const typename _Myself::second_type&, _Ty2>>,
366
- int> = 0>
361
+ template <class _Myself = pair>
362
+ requires _Is_assignable_no_precondition_check<const typename _Myself::first_type&, _Ty1>::value
363
+ && _Is_assignable_no_precondition_check<const typename _Myself::second_type&, _Ty2>::value
367
364
constexpr const pair& operator=(_Identity_t<_Myself&&> _Right) const
368
365
noexcept(conjunction_v<is_nothrow_assignable<const _Ty1&, _Ty1>,
369
366
is_nothrow_assignable<const _Ty2&, _Ty2>>) /* strengthened */ {
@@ -386,10 +383,9 @@ struct pair { // store a pair of values
386
383
}
387
384
388
385
#if _HAS_CXX23
389
- template <class _Other1, class _Other2,
390
- enable_if_t<conjunction_v<negation<is_same<pair, pair<_Other1, _Other2>>>,
391
- is_assignable<const _Ty1&, const _Other1&>, is_assignable<const _Ty2&, const _Other2&>>,
392
- int> = 0>
386
+ template <class _Other1, class _Other2>
387
+ requires (!is_same_v<pair, pair<_Other1, _Other2>>)
388
+ && is_assignable_v<const _Ty1&, const _Other1&> && is_assignable_v<const _Ty2&, const _Other2&>
393
389
constexpr const pair& operator=(const pair<_Other1, _Other2>& _Right) const
394
390
noexcept(is_nothrow_assignable_v<const _Ty1&, const _Other1&>
395
391
&& is_nothrow_assignable_v<const _Ty2&, const _Other2&>) /* strengthened */ {
@@ -411,10 +407,9 @@ struct pair { // store a pair of values
411
407
}
412
408
413
409
#if _HAS_CXX23
414
- template <class _Other1, class _Other2,
415
- enable_if_t<conjunction_v<negation<is_same<pair, pair<_Other1, _Other2>>>, is_assignable<const _Ty1&, _Other1>,
416
- is_assignable<const _Ty2&, _Other2>>,
417
- int> = 0>
410
+ template <class _Other1, class _Other2>
411
+ requires (!is_same_v<pair, pair<_Other1, _Other2>>)
412
+ && is_assignable_v<const _Ty1&, _Other1> && is_assignable_v<const _Ty2&, _Other2>
418
413
constexpr const pair& operator=(pair<_Other1, _Other2>&& _Right) const
419
414
noexcept(is_nothrow_assignable_v<const _Ty1&, _Other1>
420
415
&& is_nothrow_assignable_v<const _Ty2&, _Other2>) /* strengthened */ {
@@ -481,8 +476,8 @@ _CONSTEXPR20 void swap(pair<_Ty1, _Ty2>& _Left, pair<_Ty1, _Ty2>& _Right) noexce
481
476
}
482
477
483
478
#if _HAS_CXX23
484
- _EXPORT_STD template <class _Ty1, class _Ty2,
485
- enable_if_t<is_swappable_v< const _Ty1> && is_swappable_v <const _Ty2>, int> = 0>
479
+ _EXPORT_STD template <class _Ty1, class _Ty2>
480
+ requires is_swappable< const _Ty1>::value && is_swappable <const _Ty2>::value // TRANSITION, /permissive needs ::value
486
481
constexpr void swap(const pair<_Ty1, _Ty2>& _Left, const pair<_Ty1, _Ty2>& _Right) noexcept(
487
482
noexcept(_Left.swap(_Right))) {
488
483
_Left.swap(_Right);
0 commit comments