aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libstdc++-v3/include/bits/move.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h
index 085ca07..061e6b4 100644
--- a/libstdc++-v3/include/bits/move.h
+++ b/libstdc++-v3/include/bits/move.h
@@ -215,14 +215,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @return Nothing.
*/
template<typename _Tp>
- _GLIBCXX20_CONSTEXPR
- inline
-#if __cplusplus >= 201103L
- typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
- is_move_constructible<_Tp>,
- is_move_assignable<_Tp>>::value>::type
+#if __glibcxx_concepts // >= C++20
+ requires (! __is_tuple_like<_Tp>::value)
+ && is_move_constructible_v<_Tp>
+ && is_move_assignable_v<_Tp>
+ constexpr void
+#elif __cplusplus >= 201103L
+ _GLIBCXX20_CONSTEXPR inline
+ __enable_if_t<__and_<__not_<__is_tuple_like<_Tp>>,
+ is_move_constructible<_Tp>,
+ is_move_assignable<_Tp>>::value>
#else
- void
+ inline void
#endif
swap(_Tp& __a, _Tp& __b)
_GLIBCXX_NOEXCEPT_IF(__and_<is_nothrow_move_constructible<_Tp>,
@@ -241,12 +245,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// DR 809. std::swap should be overloaded for array types.
/// Swap the contents of two arrays.
template<typename _Tp, size_t _Nm>
- _GLIBCXX20_CONSTEXPR
- inline
-#if __cplusplus >= 201103L
- typename enable_if<__is_swappable<_Tp>::value>::type
+#if __glibcxx_concepts // >= C++20
+ requires is_swappable_v<_Tp>
+ constexpr void
+#elif __cplusplus >= 201103L
+ _GLIBCXX20_CONSTEXPR inline
+ __enable_if_t<__is_swappable<_Tp>::value>
#else
- void
+ inline void
#endif
swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
_GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Tp>::value)