Rewrite range-based for statement.