
At 08:26 AM 7/31/2008, you wrote:
I would rather put "bool is_shared() const { return m_reference_counter > 1; }" as protected member, and m_reference_counter as private one. Do you need it for something like "intrusive_from_this()" form Boost.Statechart ?
I haven't used Boost.Statechart so I can't speak to that. I do lot of psuedo-value classes, which are PIMPL classes based on intrusive_ptr that do copy on write to act like values instead of handles when it matters (Qt from Trolltech does a lot of that, for a public example). That has an obvious need to test for the reference count being larger than 1. Rather than is_shared(), you might duplicate the shared_ptr interface, with unique() and use_count(). That'd probably be better for something including in Boost.