Condividi tramite


Errore del compilatore C2933

'class': type-class-id ridefinito come membro typedef di 'identifier'

Non è possibile usare una classe generica o modello come typedef membro.

Questo errore è obsoleto in Visual Studio 2022 e versioni successive.

L'esempio seguente genera l'errore C2933:

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

struct TC2 { };
struct MyStruct2 {
   typedef int TC2;
};

L'errore C2933 può verificarsi anche quando si usano i generics:

// C2933b.cpp
// compile with: /clr /c
generic<class T> ref struct GC { };
struct MyStruct {
   typedef int GC<int>;   // C2933
};

ref struct GC2 { };
struct MyStruct2 {
   typedef int GC2;
};