I think I’m missing something simple here. I’m using Boost’s shared_ptr.
shared_ptr<Foo> pA(new Foo());
shared_ptr<Foo> pB(new Foo());
Now, I want to switch pB so it contains the contents of pA, decrementing the ref count of pB. How can I do this?
It’s all done automatically: