Compiler Error C2937
TOC
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Compiler Error C2937

Error Message

'class' : type-class-id redefined as a global typedef

You cannot use a generic or template class as a global typedef.

The following sample generates C2937:

// C2937.cpp
// compile with: /c
template<class T> 
struct TC { };
typedef int TC<int>;   // C2937
typedef TC<int> c;   // OK

C2937 can also occur when using generics:

// C2937b.cpp
// compile with: /clr
generic<class T>
ref struct GC { };
typedef int GC<int>;   // C2937
typedef GC<int> xx;   // OK
Show:
© 2016 Microsoft