The undisputed magic of shared_ptr.
July 10th, 2006Lately there has been alot of talks about TR1 (Technical Report 1) and its adoption of Boosts shared_ptr. Now, I must admit that I like to control the lifetime of my objects myself thus I haven’t used it extensively, but I can see the benefits of writing sloppy code and being saved by the smart pointer. There is still one magic aspect of the shared_ptr that I don’t like, namely its ability to choose the correct destructor even when the base class’ destructor is non-virtual.












