c++ partial specialization: How can I specialize this template<class T1, class T2> to this template<class T1>?
#include <iostream> using namespace std; template <class T1, class T2> class A { public: void taunt() { cout << "A"; } }; template <class T1> class A<T1, T1> { public: void taunt() { cout << "B"; } }; class B {}; class C {}; int main (int argc, char * const argv[]) { A<B> a; return 0; } How can I convert my two parameter template to a one parameter template? The above code will give a compiler error on 'A a;' for 'wrong number of template arguments'. Template specialization can't be used to reduce the number of template arguments, to do that you should use defaults for some of the arguments.