fixed auto iterator in cpp