[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/types/is_swappable [Back]  [Original]

std::is_swappable_with, std::is_swappable, std::is_nothrow_swappable_with, std::is_nothrow_swappable cppreference.com
cppreference.com

std::is_swappable_with, std::is_swappable, std::is_nothrow_swappable_with, std::is_nothrow_swappable

cppreference.com
 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
(C++11)
(C++14)  
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++14)
(C++11)
(C++11)( C++20*)
(C++11)( C++20)
(C++11)
(C++17)
(C++11)(C++11)(C++11)
(C++11)( C++23)
(C++11)( C++23)
(C++11)
(C++11)
(C++17)

(C++11)( C++20*)(C++17)
 
<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&>::value
3) , (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.


( ) []
,
( ) []
,
() []

Web Proxy Viewer  |  New URL  |  Original Page