Boost logo

Boost Users :

From: Alan M. Carroll (amc_at_[hidden])
Date: 2006-03-20 08:43:45


At 04:13 AM 3/20/2006, James Hughes wrote:
>Hello All,
>
>I have a couple of classes that I want to self register themselves with a
>monitoring class. To do this they must pass a shared_ptr of 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).


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