17 Jan
2006
17 Jan
'06
1:16 a.m.
On 16/01/06, Pierre THIERRY
Is there a problem to have shared_ptr<T>::operator=(T*)?
As I understand it, it's not allowed so that it's very clear when it's done. Once a pointer ends up in a shared_ptr, there's no way to get it out of one, so independently creating 2 shared_ptrs that both own the same memory location is a recipe for disaster. There's always "shared_ptr<Foo> ptr_foo( new Foo );", which is less typing than either anyways. - Scott