Consider this code:
#include
void Example()
{
std::vector list;
TCHAR* pLine = new TCHAR[20];
list.push_back(pLine)
You could just write a simple template function that does this for you:
template
void deleteInVector(vector* deleteme) {
while(!deleteme->empty()) {
delete deleteme->back();
deleteme->pop_back();
}
delete deleteme;
}
Maybe something in here is bad practice but I don't think so. It looks okay to me though comments are always nice.