Suppose I have a class Widget and I do something like the following:
vector<Widget*> wlist;
wlist.push_back( new Widget());
wlist.push_back( new Widget());
...
Now, when the wlist goes out of scope, is there a nice way for the allocated Widget to be free'd? Is there a C++ idiom to do this? I thought auto_ptr would, but then I read you shouldn't use it in a STL.