|
Boost Users : |
Subject: Re: [Boost-users] intrusive_ptr vs shared-ptr
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2013-01-22 15:56:50
On Tue, Jan 22, 2013 at 3:46 AM, John M. Dlugosz <mpbecey7gu_at_[hidden]>wrote:
>
> I really miss having a "lost and found" feature, which (in the late 90's)
> I wrote about as being one of the six essential features of my smart
> pointer design.
Yes, I was wondering if the magic call inside of smart_ptr's constructor,
that handles the enabled_shared_from_this, wouldn't be better as a free
function, like smart_pointer_being_created(), which gives you an extension
point to go look up whether the object already had a smart pointer. It
could default back to the enabled_shared_from_this trick if you don't
override it for your types, etc.
Qt's smart pointer has extra tracking like this - typically only turned on
in debugging.
Tony
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net