template< class T, class U >
struct is_swappable_with;
template< class T >
struct is_swappable;
template< class T, class U >
struct is_nothrow_swappable_with;
template< class T >
struct is_nothrow_swappable;
are performed as if from a context unrelated to either type.
3) Same as (1), but evaluations of both expressions from (1) are known not to throw exceptions.
Type trait The value of the member constantvalue
T
is a referenceable type T
is not a referenceable type (2) std::is_swappable_with<T&, T&>::value false (4) std::is_nothrow_swappable_with<T&, T&>::value
If T
or U
is not a complete type, (possibly cv-qualified) void, or an array of unknown bound, the behavior is undefined.
If an instantiation of a template above depends, directly or indirectly, on an incomplete type, and that instantiation could yield a different result if that type were hypothetically completed, the behavior is undefined.
If the program adds specializations for any of the templates described on this page, the behavior is undefined.
[edit] Helper variable templatestemplate< class T, class U >
inline constexpr bool is_swappable_with_v = is_swappable_with<T, U>::value;
template< class T >
inline constexpr bool is_swappable_v = is_swappable<T>::value;
inline constexpr bool is_nothrow_swappable_with_v =
inline constexpr bool is_nothrow_swappable_v =
T
is swappable with U
, false otherwise
This trait does not check anything outside the immediate context of the swap expressions: if the use of T
or U
would trigger template specializations, generation of implicitly-defined special member functions etc, and those have errors, the actual swap may not compile even if std::is_swappable_with<T, U>::value compiles and evaluates to true.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4