On Thursday 15 July 2004 04:42, MenTaLguY wrote:
On Wed, 2004-07-14 at 19:29, Aubanel MONNIER wrote:
For the momment, I used shared_ptr from boost.
http://www.boost.org/libs/smart_ptr/shared_ptr.htm
but maybe we should provide our own implementation ?
Not saying that we must put smart pointers everywhere, but in some circumstancies they are very usefull (eg when dealing with containers)
Even when using generic containers, those containers should generally not be exposed in public interfaces, so the enclosing class can safely manage refcounts as it adds or removes objects.
Of course, when there is a mark-and-sweep garbage collector involved we generally don't need to worry about reference counts at all. Even STL containers can use a GC-aware allocator.
-mental
OK, so I stick with manual delete for the momment. It's just that deleting vector elements ain't fun. In fact, I'm not used to smart pointers, but to answering one of my questions, I was suggested to do it that way.
Will the gc be included for 0.4 or is this planned for later ? Do you need some help to do that ?
Regards, OBI.