Condividi tramite


Errore del compilatore C3076

'instance': non è possibile incorporare un'istanza di un tipo riferimento, 'type', in un tipo nativo

Osservazioni:

Un tipo nativo non può contenere un'istanza di un tipo CLR.

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

Esempio

L'esempio seguente genera l'errore C3076.

// C3076.cpp
// compile with: /clr /c
ref struct U {};

struct V {
   U y;   // C3076
};

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