הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
redefinition : 'class' : class template or generic is being redeclared as 'type'
Remarks
A generic or template class has multiple declarations that are not equivalent. To fix this error, use different names for different types, or remove the redefinition of the type name.
Examples
The following example generates C2921:
// C2921.cpp
// compile with: /c
template <class T> struct TC2 {};
typedef int TC2; // C2921
// try the following line instead
// typedef struct TC2<int> x; // OK - declare a template instance
C2921 can also occur when using generics.
// C2921b.cpp
// compile with: /clr /c
generic <class T> ref struct GC2 {};
typedef int GC2; // C2921
// try the following line instead
// typedef ref struct GC2<int> x;