1 #ifndef INCG_PHI_CORE_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_WITH_HPP 2 #define INCG_PHI_CORE_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_WITH_HPP 4 #include "phi/phi_config.hpp" 6 #if PHI_HAS_EXTENSION_PRAGMA_ONCE() 10 #include "phi/algorithm/swap.hpp" 11 #include "phi/compiler_support/constexpr.hpp" 12 #include "phi/compiler_support/inline_variables.hpp" 13 #include "phi/compiler_support/noexcept.hpp" 14 #include "phi/compiler_support/warning.hpp" 15 #include "phi/core/declval.hpp" 16 #include "phi/type_traits/integral_constant.hpp" 17 #include "phi/type_traits/is_swappable_with.hpp" 19 DETAIL_PHI_BEGIN_NAMESPACE()
21 PHI_GCC_SUPPRESS_WARNING_PUSH()
22 PHI_GCC_SUPPRESS_WARNING("-Wnoexcept")
26 template <
typename TypeT,
typename OtherT = TypeT,
30 static PHI_CONSTEXPR_AND_CONST
bool value =
31 PHI_NOEXCEPT_EXPR(swap(declval<TypeT>(), declval<OtherT>())) &&
32 PHI_NOEXCEPT_EXPR(swap(declval<OtherT>(), declval<TypeT>()));
35 template <
typename TypeT,
typename OtherT>
40 template <
typename TypeT,
typename OtherT>
42 :
public integral_constant<bool, detail::is_nothrow_swappable_with_impl<TypeT, OtherT>::value>
45 template <
typename TypeT,
typename OtherT>
47 :
public integral_constant<bool, !is_nothrow_swappable_with<TypeT, OtherT>::value>
50 PHI_GCC_SUPPRESS_WARNING_POP()
52 #if PHI_HAS_FEATURE_VARIABLE_TEMPLATE() 54 template <
typename TypeT,
typename OtherT>
55 PHI_INLINE_VARIABLE PHI_CONSTEXPR
bool is_nothrow_swappable_with_v =
58 template <
typename TypeT,
typename OtherT>
59 PHI_INLINE_VARIABLE PHI_CONSTEXPR
bool is_not_nothrow_swappable_with_v =
64 DETAIL_PHI_END_NAMESPACE()
66 #endif // INCG_PHI_CORE_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_WITH_HPP Definition: integral_constant.hpp:19
Definition: is_nothrow_swappable_with.hpp:46
Definition: is_nothrow_swappable_with.hpp:28
Definition: is_swappable_with.hpp:41
Definition: is_nothrow_swappable_with.hpp:41