Re: [boost] Re: shared_ptr with 0 use_count

2003-02-10 Thread Peter Dimov
dynalink wrote: > I need to create a single instance of X and have it disappear when > the > final B pointer goes out of scope. The problem with this code is that > A::m_X immediately bumps the ref count and only goes out of scope on > termination. > > Here's a simple example: > > class X;

[boost] Re: shared_ptr with 0 use_count

2003-02-10 Thread dynalink
I need to create a single instance of X and have it disappear when the final B pointer goes out of scope. The problem with this code is that A::m_X immediately bumps the ref count and only goes out of scope on termination. Here's a simple example: class X;// defined elsewhere; in my case wra