Compiler Error C2943

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C2943.

class' : type-class-id redefined as a type argument of a template

You cannot use a generic or template class, instead of a symbol, as a generic or template type argument.

The following sample generates C2943:

// C2943.cpp  
// compile with: /c  
template<class T>  
class List {};  
  
template<class List<int> > class MyList;   // C2943  
template<class T >  class MyList;  

Show: