Use C++11 range iteration rather than old-style for-with-++.