With C++/CLI value types can be put on the stack, or on the native or managed heaps.
value class MyData
{
property int Simple;
};
Declaring the variable locally, the object is put on the stack.
MyData d1;
d1.Simple = 11;
Using the pointer syntax, the object can be put on the native heap:
MyData* pd2 = new MyData();
pd2->Simple = 22;
delete pd2;
With the gcnew operator boxing and unboxing is done behind the scenes:
MyData^ d3 = gcnew MyData();
d3->Simple = 33;
delete d3; // invokes Dispose
Christian