Suppose I have a template function:
template
void f(T t)
{
...
}
and I want to write a specialization for all primiti
I would use overload resolution. That spares you from having to use the gross SFINAE hack. Unfortunately there are many areas where you can't avoid it, but this fortunately isn't one of those.
template
void f(T t)
{
f(t, std::is_integral());
}
template
void f(T t, std::true_type)
{
// ...
}
template
void f(T t, std::false_type)
{
// ...
}