
25 Dec
2008
25 Dec
'08
3:40 p.m.
Have you tried using auto_ptr? It forces the right-hand side of the assignment to give up ownership. boost::shared_ptr<A> p1(new A()); std::auto_ptr<A> p2; p2 = p1; //p1 is now null and p2 points to what p1 was pointing to Hope this works! I haven't tested this and my C++/Boost/STL is very shaky due to disuse. Ben