1#ifndef HAS_UNARY_MINUS_H
2#define HAS_UNARY_MINUS_H
23template <
typename T,
typename A =
void>
26 static constexpr bool value =
false;
31 T, typename std::enable_if_t<!std::is_unsigned<hila::arithmetic_type<T>>::value &&
32 hila::is_assignable<T &, decltype(-std::declval<T>())>::value>> {
34 static constexpr bool value =
true;
41template <
typename T,
typename A =
void>
44 static constexpr bool value =
false;
48class has_assign_zero<T, typename std::enable_if_t<hila::is_arithmetic<T>::value ||
49 hila::is_assignable<T &, int>::value ||
50 hila::is_assignable<T &, std::nullptr_t>::value>> {
52 static constexpr bool value =
true;
hila::has_assign_zero<T>::value returns true if '= 0 is defined for T
Conditionally reture bool type false if type T does't have unary - operator.
Implement hila::swap for gauge fields.