I have a map of objects and I copied one object to the local variable and then delete the object in the map. Could this create a problem when I work on local object?
std::map<int, obj>::iterator it2 = mymap.find(objnum);
mylocalobj = it2->second;
mymap.erase(it2);
//continue working on mylocalobj