fixed auto iterator in cpp
Merge pull request #271 from williamhmm/master

fixed auto iterator in cpp