Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-08-17 11:18:44


"Martin Bonner" <martin.bonner_at_[hidden]> wrote in message
> B) Under what circumstances is a std::container<clone_ptr<T> > better than
a
> boost::ptr_container<T>?

I won't discuss if its better, but its certainly very different
in thefollowing sense:

- ptr_container<T> discourages cloning of T objects and doesn't require it
- vector<clone_ptr<T>> requires cloning of T objects (and hence encourages
it)

If T is an OO-type with virtual functions, I find that identity often
matters
(performance and logical-wise) and hence
that excessive cloning is best avoided.

-Thorsten


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