Question: ```
template <class T1, class T2>
class A {};

template <class T1>
class A {};

A<int, int> a;
A<int> b;

```

This code generates 

> 
> error C2976: 'A' : too few template arguments
> 
> 
> 

at the second diclaration of 'A' class.

Answer: 
Your first declaration defines a class `A` with 2 template arguments. Anything after that must either be a specialization of that or some other enabled version.

If you want to allow either 1 or 2 template arguments you can use variadic templates as follows:

```
template <class... Args>
class A;

template <class T1, class T2>
class A<T1, T2> {};

template <class T1>
class A<T1> {};

```

[`Live demo`](http://coliru.stacked-crooked.com/a/72142d644c91b44d)
There is no SFINAE going on here. You are redeclaring the class `A`, originally with 2 template parameters, to another one with only 1 template parameters, and hence the error. g++ gives a more explicit error:

> 
> error: redeclared with 1 template parameter class A {};
> 
> 
> note: previous declaration 'template class A' used 2 template parameters
> 
> 
>