Original Post
when creating the map object like so std::map I want my key_type to be an int, but I want my data_type to be a pointer to an object, such as myClass. So can I do this... std::map myMap; and if this is a valid way to do this, will I need to free the data manually before I erase an element of the map? and if the program is exiting, do I loop through all remaining elements of the map and make sure i free each pointer before the program ends? any tips would be great thanks :)