How much do using smart pointers, particularly boost::shared_ptr cost more compared to bare pointers in terms of time and memory? Is using bare pointers better for performance i
There's an often overlooked halfway-house between a "manually" managed std::vector
(ie raw pointers) and a std::vector
, in the form of the boost::ptr_container classes.
These combine the performance of a raw pointer container with the convenience of a container of smart pointers (ie they provide the functionality people would like STL containers of std::auto_ptr
to provide, if that worked).