編譯器警告 (層級 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 問題,並以全新的意見反應系統取代並作為內容意見反應的渠道。 如需更多資訊,請參閱:提交及檢視以下的意見反映: