std::is_swappable_with, std::is_swappable, std::is_nothrow_swappable_with, std::is_nothrow_swappable
cppreference.com
<tbody>
</tbody>
template< class T, class U > struct is_swappable_with; |
(1) | ( C++17) |
template< class T > struct is_swappable; |
(2) | ( C++17) |
template< class T, class U > struct is_nothrow_swappable_with; |
(3) | ( C++17) |
template< class T > struct is_nothrow_swappable; |
(4) | ( C++17) |
1)
swap(std::declval<T>(), std::declval<U>())
swap(std::declval<U>(), std::declval<T>()) using std::swap; ( Swappable), - value, true. value false. , . 2)
T , (.., , cv- void cv- ), - value, false. - value, std::is_swappable_with<T&, T&>::value3) , (1), , (1)
4) , (2),
std::is_nothrow_swappable_with.T U , (, cv-) void . .
, , , .
, , .
<tbody> </tbody>
template <class T, class U> inline constexpr bool is_swappable_with_v = is_swappable_with<T, U>::value; |
( C++17) | |
template <class T> inline constexpr bool is_swappable_v = is_swappable<T>::value; |
( C++17) | |
template <class T, class U> inline constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with<T, U>::value; |
( C++17) | |
template <class T> inline constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<T>::value; |
( C++17) | |
std::integral_constant
value [static] |
true, T U , false (public static -) |
-
operator bool |
bool, value (public -) |
operator() (C++14) |
value (public -) |
value_type
|
bool
|
type
|
std::integral_constant<bool, value>
|
: T U , - .., , , std::is_swappable_with<T,U>::value true.
| : |
| ( ) | |
(C++11)(C++11)(C++11) |
, ( ) |
(C++20) |
, () |