fixed auto iterator in cpp

Supposed to iterate over a container.