Compiler Error C3076
'instance' : you cannot embed an instance of a reference type, 'type', in a native type
A native type cannot contain an instance of a CLR type.
For more information, see C++ Stack Semantics for Reference Types.
Example
The following sample generates C3076.
// C3076.cpp
// compile with: /clr /c
ref struct U {};
struct V {
U y; // C3076
};
ref struct W {
U y; // OK
};
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for