Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2002-06-19 12:01:00

"David B. Held" <dheld_at_[hidden]> wrote in message
> [...]
> class foo : boost::counted_base

Obviously, you can't inherit privately, or nobody will know this is really
a counted_base class.

Of course, one of the primary benefits of an intrusive pointer is the
ability to create one from a raw pointer. I should have illustrated that,
like so:

    foo* x;
    boost::intrusive_ptr<foo> p(x = new foo);
    // count is 1
        boost::shared_ptr<foo> q(p);
        // count is 2
        // count is 3
    // count is 1
// count is 0, foo destroyed


Boost list run by bdawes at, gregod at, cpdaniel at, john at