If vector holds objects, will it delete the pointers when destroyed?
If I have a vector of SomeClass objects and those objects are created inside another method using "new", will the vector properly handle memory management when destroyed? Or do i have to keep track of them and delete them myself?
//I have no control over the type of this,
//so I have to populate a vector<SomeClass>
//instead of vector<SomeClass*>
return * ( new SomeClass() );
std::vector<SomeClass> r = getDataHolder();
r.push_back( getData() );