Export (0) Print
Expand All
Expand Minimize

Compiler Error C2944

Error Message

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

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

The following sample generates C2944:

// C2944.cpp
// compile with: /c
template<class T>
class TC { }; 

template <int TC<int> > struct X1 { };   // C2944

template <class T > struct X2 {};

C2944 can also occur when using generics:

// C2944b.cpp
// compile with: /clr /c
generic<class T>
ref class GC {};

template <int GC<int> > struct X2 { };   // C2944
template <class T> struct X3 {};   // OK

Community Additions

ADD
Show:
© 2015 Microsoft