Something like this,



#include <memory>
//
class Foo {};
//
std::vector<std::shared_ptr<Foo>> m_myVector;
//