I have a class like this:
class A
{
private:
B* ptr;
}
But B ptr is shared among different A objects. How can I use auto_ptr so that when A gets destructed B stays on so that other A objects that point to the same ptr can continue without issues. Does this look ok:
class A
{
public:
auto_ptr< B > m_Ptr;
private:
B* ptr;
}
what are the different ways people have implemented this and any issues/advantages they saw one to another... Thanks