Boost logo

Boost :

From: Kevin Spinar (spinarkm_at_[hidden])
Date: 2006-07-08 17:46:31


(this will be the first and last "progress update" message until it comes
time to summit for a review to boost)

For better or for worse (it seems there's much debate on clone_ptr) I have
started on the clone_ptr library and have a working preliminary clone_ptr
class. Details can be found at the following URL and I will update the
website as my work progresses:

http://www.peltkore.net/~alipha/clone_ptr.html

If anyone is interested in receiving email updates or would like to
collaborate on the project (which could just simply be someone I could
bounce ideas off of) email me.

To contribute some to the discussion:

It has been noted that the Boost.pointer_container library could be used
instead of having a container of clone_ptr. However, what if you want to
use non-standard containers? Yes, Boost.pointer_container has ptr_*_adapter
classes, but they can't be used for containers which don't follow the
container requirements set by the C++ standard. Secondly, even if a third
party container class follows the container requirements, it is still
unnecessary work to create your own pointer container. Consider this generic
tree class:

http://www.aei.mpg.de/~peekas/tree/
http://www.aei.mpg.de/~peekas/tree/doxygen/html/functions.html

There's dozens of functions in the tree class that would have to be wrapped
in a ptr_tree class that the boost::ptr_sequence_adapter class doesn't wrap
for you. Compare this to:

tree<clone_ptr<T> > foo;

The clone_ptr solution seems a lot easier. The same argument could be made
with boost::graph, etc.

Also, I've decided to give clone_ptr clone-on-write semantics instead of
clone-on-copy. This should alleviate any concerns about performance when
inserting into a std::vector or copying containers (copying clone_ptr would
give similar performance to boost::shared_ptr).

Kevin Spinar


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk