I read that it is automatically allocated on the managed and is a convenience
of C++. Also a destructor and !N() (finalize) methods should be defined for
any cleanup. The destructor can call the finalizer e.g. this->!()N so they
can both use the came code.
The idea is that the destructor will be called for cases of classes
instantiated as local variables (my original posted question) and the
finalizer is called by the GC for normal object instantiations via gcnew.
--
Greg McPherran
www.McPherran.com
"Greg" wrote:
In the following example, where is "n" allocated (e.g. managed heap?) ?
public ref class N
{
...
...
}
main()
{
N^ n_handle; // allocated on managed heap
N n; // Where is this allocated? Not on native stack, right?
}
--
Greg McPherran
www.McPherran.com