コンパイラの警告 (レベル 1) C4688

'constraint': 制約リストはアセンブリ プライベート型 'type' を含んでいます

制約リストにアセンブリ プライベート型があります。つまり、型にアセンブリの外部からアクセスする場合は、このリストを使用できません。 詳細については、「ジェネリック」を参照してください。

次の例では C4688 警告が生成されます。

// C4688.cpp
// compile with: /clr /c /W1
ref struct A {};   // private type
public ref struct B {};

// Delete the following 3 lines to resolve.
generic <class T>
where T : A   // C4688
public ref struct M {};

generic <class T>
where T : B
public ref struct N {};