Simplify for loops with auto