
14 Apr
2009
14 Apr
'09
7:47 p.m.
Mathias Gaunard wrote:
Achilleas Margaritis wrote:
There are three ways to add garbage collection to an object:
1) inherit from gc_object<T>. 2) wrap your class in gc_wrapper<T>. 3) allocate your object with new(T_deleter)..
But you should modify your pointers to be gc_ptr<T> instances for this to work.
So, comparing your framework to C++/CLI: - new(T_deleter) is like gcnew - gc_ptr<T> is like T^ - inheriting from gc_object<T> is like declaring a class as being a ref class
Is that right?
Indeed.