1#ifndef HAS_UNARY_MINUS_H
2#define HAS_UNARY_MINUS_H
23template <
typename T,
typename A =
void>
26 static constexpr bool value =
false;
41 T, typename std::enable_if_t<!std::is_unsigned<hila::arithmetic_type<T>>::value &&
42 hila::is_assignable<T &, decltype(-std::declval<T>())>::value>> {
44 static constexpr bool value =
true;
51template <
typename T,
typename A =
void>
54 static constexpr bool value =
false;
58class has_assign_zero<T, typename std::enable_if_t<hila::is_arithmetic<T>::value ||
59 hila::is_assignable<T &, int>::value ||
60 hila::is_assignable<T &, std::nullptr_t>::value>> {
62 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.