編譯器錯誤 C3218
'type' :不允許做為條件約束的類型
若要讓型別成為條件約束,它必須是 Managed 類別或介面的實值型別或參考。
範例
下列範例會產生 C3218。
// C3218.cpp
// compile with: /clr /c
class A {};
ref class B {};
// Delete the following 3 lines to resolve.
generic <class T>
where T : A // C3218
ref class C {};
// OK
generic <class T>
where T : B
ref class D {};