Use auto declaration specifier in ranged for loops