编译器警告(等级 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 {};
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈