Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Error C2932

Error Message

'class' : type-class-id redefined as a data member of 'identifier'

You cannot use a generic or template class as a data member.

The following sample generates C2932:

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

struct MyStruct {
   int TC<int>;   // C2932
   int TC;   // OK

C2932 can also occur when using generics:

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

struct MyStruct {
   int GC<int>;   // C2932
   int GC;   // OK

Community Additions

© 2015 Microsoft