Dave Abrahams wrote:
Actually, shared_ptr magically deals with this problem by instantiating theThat's something I missed in skimming the implementation, it looked as though it was done in the header file. I guess I still find myself on the side of seeing the benefits of policy based implementation, and finding it hard to see the how it makes things more complex, other than for people trying to create new smart pointers implementations, which I would argue is difficult in itself and prone to more error than creating the necessary traits class for a policy based system.
deleter at the point where it takes ownership of its resource. As long as
that's on the same side of the DLL boundary where the resource was
allocated, you're golden.
While working on Mozilla one of the cons against using Boost's shared pointer was that it incurred additional storage for the counter, and the engineers working on Mozilla wanted an intrusive implementation where the counter was stored with the object. It looks like the current implementation there is no way other than to create yet another smart pointer class to do this. Had Boost gone the policy based route, Mozilla would have been able to use such a smart pointer, as it is, Mozilla is reinventing the wheel instead of using Boost.
David Bradley
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost