共用方式為


編譯器錯誤 C3216

條件約束必須是泛型參數,而非 'type'

備註

條件約束的格式錯誤。

Example

下列範例會產生 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 {};