16 Jan
2006
16 Jan
'06
11:53 p.m.
I use more and more BOOST smart pointers instead of plain pointers in my C++ code, and it is incredible how it saves time and prevent bugs! But I was wondering why one couldn't just change the type of a pointer a keep all code as it is, instead of having to change affectation to reset(), for example. E.g., the following code: Foo* ptr_foo; ptr_foo = new Foo; Has now to be changed to: shared_ptr<Foo> ptr_foo; ptr_foo.reset(new Foo); But I'd like it to be: shared_ptr<Foo> ptr_foo; ptr_foo = new Foo; Is there a problem to have shared_ptr<T>::operator=(T*)? Curiously, Nowhere man -- nowhere.man@levallois.eu.org OpenPGP 0xD9D50D8A