Condividi tramite


Avviso del compilatore (livello 1) C4688

'constraint': l'elenco di vincoli contiene il tipo privato 'type' dell'assembly

Un elenco di vincoli include un tipo privato dell'assembly. Questo significa che il tipo non sarà disponibile se si accede dall'esterno dell'assembly. Per altre informazioni, vedere Generics.

Esempio

L'esempio seguente genera l'errore 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 {};