编译器错误 C2823

typedef 模板是非法的

注解

typedef 定义中不允许使用模板。

示例

以下示例生成 C2823,并显示修复它的一种方法:

// C2823.cpp
template<class T>
typedef struct x {
   T i;   // C2823 can't use T, specify data type and delete template
   int i;   // OK
} x1;