
17 Aug
2005
17 Aug
'05
4:18 p.m.
"Martin Bonner" <martin.bonner@pitechnology.com> 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