
From what I'm reading in your message it does sound cleverer than just going through copy-constructors. Especially if it's capable of handling STL/Boost containers including container of pointers - that would seem to be a great help in keeping
UNCLASSIFIED the user code simpler. While the elegance of the usage may be obvious, the question may arise as to the performance of it. So as long as it is implemented in a performance aware way (i.e. for the best performance possible), I'd have no problems seeing some/many overall benefits. However, it would then be HIGHLY desirable to support generic allocators with allocators' type-defined pointer types. Following this would make it "boost::interprocess" compatible. That requirement would be very high on my list. Thank you and looking forward to something like this. Regards Gabe Gabe Levy Senior Software Engineer, HiQ Systems Pty Ltd WSD, 201L, Edinburgh, SA
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Allan Johns Sent: Tuesday, 25 October 2011 12:53 PM To: boost@lists.boost.org Subject: Re: [boost] Interest in boost.deepcopy
Consider an object hierarchy in which there may be multiple references
to shared objects. A deep copy should give an identical, but entirely separate copy of the entire structure.
Also consider eg std::map<std::string,T*>... the std::map copy constructor is not going to create new instances of T in the copy - this is a shallow copy.
You could argue that I should write a custom smart pointer to perform a deep copy in its copy constructor, but for multiple reasons I'd quite like to not have to do this, and to use boost::shared_ptr as normal.
On Tue, Oct 25, 2011 at 1:13 PM, Steven Watanabe <watanabesj@gmail.com>wrote:
AMDG
Just gauging initial interest in a boost.deepcopy library, analogous to deepcopy in python. Each type would register deepcopy behaviour with
On 10/24/2011 05:16 PM, Allan Johns wrote: the
library (there are similarities to boost.serialize). Boost.deepcopy would supply out-of-the-box registration for pod types, pointer types, arrays, stl containers and common boost containers. Example:
I'm not sure why I would want to use something like this. Normally,
in C++, the copy constructor is expected to do a deep copy, when it exists.
In Christ, Steven Watanabe
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
IMPORTANT: This email remains the property of the Department of Defence and is subject to the jurisdiction of section 70 of the Crimes Act 1914. If you have received this email in error, you are requested to contact the sender and delete the email.