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;
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