編譯器錯誤 C3297
'constraint_2': 因為 'constraint_1' 有值條件約束,所以 'constraint_1' 不能用做條件約束
值類別已密封。 如果條件約束是值類別,它絕對不會衍生其他的條件約束。
如需詳細資訊,請參閱泛型型別參數的限制式 (C++/CLI)。
範例
下列範例會產生 C3297。
// C3297.cpp
// compile with: /clr /c
generic<class T, class U>
where T : value class
where U : T // C3297
public ref struct R {};