Robert Edward Caldecott wrote: You don't think smart pointers are useful? I think, somebody who puts pointers or smart pointers into a std container has not understood one basic principle of STL, that is, 'value semantics'. What a shame. Other than the fact that both STL and Boost are incredibly powerful, I need to write code for Windows AND Linux, and without these libraries, this would be difficuly to achieve. It's ok if it works for you. IMO, it's not really elegant that one has to write
v.push_back(boost::shared_ptr(new CFoo));
to insert an element.