Compiler Error C3077
'finalizer' : a finalizer can only be a member of a reference type
You cannot declare a finalizer in a native or value type.
For more information, see Destructors and finalizers in How to: Define and consume classes and structs (C++/CLI).
Example
The following sample generates C3077.
// C3077.cpp
// compile with: /clr /c
value struct vs {
!vs(){} // C3077
};
ref struct rs {
protected:
!rs(){} // 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