boost::shared_ptr
has an unusual constructor
template shared_ptr(shared_ptr const & r, T * p);
and I a
It is useful when you want to share a class member and an instance of the class is already a shared_ptr, like the following:
struct A
{
int *B; // managed inside A
};
shared_ptr a( new A );
shared_ptr b( a, a->B );
they share the use count and stuff. It is optimization for memory usage.