Condividi tramite


Errore del compilatore C3075

'instance': impossibile incorporare un'istanza di un tipo riferimento, 'type', in un tipo di valore

Osservazioni:

Un tipo valore non può contenere un'istanza di un tipo riferimento.

Per altre informazioni, vedere Semantica dello stack C++ per i tipi di riferimento.

Esempio

L'esempio seguente genera l'errore C3075.

// C3075.cpp
// compile with: /clr /c
ref struct U {};
value struct X {
   U y;   // C3075
};

ref struct Y {
   U y;   // OK
};