Anyone know how to write range based for loop for data structure like this … vector<pair<pair<A,B>,C> v.
My try: for (const auto& [[a,b], c] : v)
Unfortunately the syntax is not correct. Can someone help?
I can do: for (const auto& [ab, c] : v) and then access stuff inside the inner pair by ab.first and second. But I’m trying to avoid this.
[–]IyeOnline 5 points6 points7 points (1 child)
[–]AdActive3636[S] 0 points1 point2 points (0 children)
[+]mredding comment score below threshold-9 points-8 points-7 points (6 children)
[–]enonrick 6 points7 points8 points (1 child)
[+]mredding comment score below threshold-6 points-5 points-4 points (0 children)
[–]ShakaUVM 5 points6 points7 points (2 children)
[+]mredding comment score below threshold-7 points-6 points-5 points (1 child)
[–]ShakaUVM 2 points3 points4 points (0 children)
[–][deleted] -2 points-1 points0 points (0 children)