Because you use enable_if
without using the template parameter T
in your function templates. If you want to specialize for when the struct S
has a certain template parameter value N
, you'll need to use class template specialization.
template <int N, class Enable = void>
struct S { };
template <int N>
struct S<N, typename std::enable_if<N == 1>::type>
{
....
};