
-----Original Message----- From: Alan M. Carroll [mailto:amc@network-geographics.com] Sent: 20 March 2006 13:44 To: boost-users@lists.boost.org Cc: boost-users@lists.boost.org Subject: Re: [Boost-users] enable_shared_from_this - or an alternative..
Hello All,
I have a couple of classes that I want to self register
monitoring class. To do this they must pass a shared_ptr of
At 04:13 AM 3/20/2006, James Hughes wrote: themselves with a themselves to
the monitor register function.
Therefore I need to make a shared_ptr form the this pointer, in the constructor.
Why not use intrusive_ptr? Way back when, I wrote my own equivalent of that instead of using Boost.shared_ptr partly for this very reason (i.e., having to use smart pointers in constructors).
Ah, just read my Boost book on intrusive pointers and I think they would work. Not sure I will use for current issues, as have now written code for a factory mechanism (which appears to work!), but certainly worth knowing for the future. Thanks Rgds James