split vector for loop into two snippets

one with typedef for iterator, the other without