
On 22 June 2012 11:03, Hite, Christopher < Christopher.Hite@partner.commerzbank.com> wrote:
Why not give him one he can move, so e.g. he can put it in a vector without getting into dynamic allocation? Why not give him a unmovable object and let him put it in a smart pointer, deciding if he wants a singlton, single owner or shared instance?
It adds noise and makes it harder to reason about. You've Here is one example: When you see a vector<shared_ptr<Foo>>, is the author's intentions: a) Make Foo storable in a vector b) Foo is polymorphic c) Really meant to have shared ownership for these Foo objects Now, if the author made Foo copyable and type erasure took care of polymorphism, vector<shared_ptr<Foo>> is really about having shared ownership. -- Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> (847) 691-1404