|
Boost Users : |
From: Thorsten Ottosen (tottosen_at_[hidden])
Date: 2006-01-17 09:38:17
Pierre THIERRY wrote:
> Le Mon, 16 Jan 2006 20:16:14 -0500, me22 a écrit :
>>There's always "shared_ptr<Foo> ptr_foo( new Foo );", which is less
>>typing than either anyways.
>
>
> But only possible at the construction. In any other place, you have to
> use reset. And the problem is, I have to modify deeply my code to use
> shared_ptr, and change it back if I stop using them.
>
> With the operator=(T*), it would need no more than a modified typedef
> for the entire code to switch to or from shared_ptr (or from any other
> type of pointer that supports this operator).
Just replacing shared_ptr<T> with T* seems to require much more than
just a typedef. If the goal is to replace boost::shared_ptr<T> with
foo::shared_ptr<T>, you might look into traits.
-Thorsten
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net