for (auto [i, j] : vector<tuple<int, int>>{{1, 7}, {3, 2}})
cout << i << j;
Is there a way to make this range-based for loop more concise by omitting type specification of the container? I don't care about its actual type, as long as it contains (mathematical not C++) pairs or tuples of integers. The form below would be the best, but it doesn't compile:
for (auto [i, j] : {{1, 7}, {3, 2}})
cout << i << j;
EDIT:
This question is not the same as Range-based for over pair list, because I use structured binding. I don't want to use first
or get<0>
for access. I'm using pair in mathematical and common sense, not std::pair
.