หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
'class' : type-class-id redefined as a global typedef
Remarks
You can't use a generic or template class as a global typedef.
This error is obsolete in Visual Studio 2022 and later versions.
Examples
The following example 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