Range-based for over pair list

Viewed 2447

Say, I want to iterate a number of pairs defined inline. Is there a shorter way to write:

for(auto pair : std::initializer_list<std::pair<int,int>>{{1,2}, {3,4}})
    // ...

?

2 Answers
Related