15 Jul
2004
15 Jul
'04
2:42 a.m.
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