2

If I have a map, I can use auto to declare variables like

map<int, float> m;
for (auto[i, f] : m) {
    ...
}

If the map is

map<int, pair<float, bool>> m;
for (auto[i, [f, b]] : m) { // not right
    ...
}

How can I still use the auto to declare a number of variables together?

user1899020
  • 13,167
  • 21
  • 79
  • 154

0 Answers0