
Matt Calabrese wrote:
On 7/1/06, Kevin Spinar <spinarkm@gmail.com> wrote:
Is there interest in a clone_ptr class to supplement the current smart_ptr library? A clone_ptr is a smart pointer which performs a deep copy of the pointed-to object whenever the clone_ptr is copied.
Yes, I would be interested. I prefer the idea of object oriented programming with value semantics, as this would easily allow for. It certainly makes working with polymorphic types much more consistent with the rest of the language.
As long as C++ does not have move-semantics, the semantics of clone_ptr seems to be far too expensive to be useful: std::vector<clone_ptr<T>> will have to re-clone all objects on buffer expansion, whereas boost::ptr_vector<T> will not. -Thorsten