How do you delete an STL map<long,class *>
New to STL. Still trying to get a handle on the right way to use it.
I have a map storing pointers to other objects:
What is the correct way to make sure all the elements of the map are deleted?
class EwMultiTrace: public map<unsigned long, EwTrace*>
Will the map call "delete()" for each stored element?
Do I have to delete each element manually?
If so, how to do that?
... this does not work. Removing elements from underneath the iterator creates memory faults.
for (item = this->begin(); item != this->end(); item++)
EwTrace *trace = item->second;
maps have no "front()" to feed you the first element until empty.
What's the right way to go?