Please consider the following scenario:
map(T,S*) & GetMap(); //Forward decleration map(T, S*) T2pS = GetMap(); for(map(T, S*)::iterator it = T2pS.begin()
I think if you modify the collection you invalidate your iterator. You can't rely on the behavior, as you found out.