编译器错误 C3226
泛型声明内不允许出现模板声明
在泛型类中使用泛型声明。
以下示例生成 C3226:
// C3226.cpp
// compile with: /clr
generic <class T>
ref class C {
template <class T1> // C3226
ref struct S1 {};
};
以下示例演示了可能的解决方法:
// C3226b.cpp
// compile with: /clr /c
generic <class T>
ref class C {
generic <class T1>
ref struct S1 {};
};
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈