I have a std::list and a std::map that I would like to empty and call delete on all the pointers.
After reading this question I am using this for the std::list:
mylist.remove_if([](myThingy* thingy) -> bool { delete thingy; return true; });
Is there something similarly concise for std::map?
Note that I cannot use a range based for loop because it isn't supported by my compiler (VC10). If it would be possible I assume
for(auto* thingy : myMap) { delete thingy; }
myMap.clear();
would work. Please correct me if I am wrong.