How can I specialise template for union
types? Suppose I have template function
template <typename T>
void foo(T value);
I want to prohibit calling this function if T
is not any union
type. How can I achieve this?
I want to prohibit calling this function if T is not any union type. How can I achieve this?
Maybe with std::is_union
?
template <typename T>
std::enable_if_t<std::is_union<T>::value> foo(T value)
{ /* ... */ }