编译器错误 C3216

约束必须是泛型参数,而不是“type”

约束格式不正确。

下面的示例生成 C3216:

// C3216.cpp
// compile with: /clr
interface struct A {};

generic <class T>
where F : A   // C3216
// Try the following line instead:
// where T : A    // C3216
ref class C {};

下面的代码示例演示了可能的解决方法:

// C3216b.cpp
// compile with: /clr /c
interface struct A {};

generic <class T>
where T : A
ref class C {};