Can I write a range based for loop in c++ with two parallel iterators
I have code like this -
class Result{
...
...
};
std::vector<Result> results;
std::vector<Result> groundTruth(2);
int gtIndex = 0;
for(auto& r:results){
auto gt = groundTruth[gtIndex];
// compare r and gt
gtIndex++;
}
I access elements from the groundTruth using gtIndex.
Question : How do I include the ground truth iterator in the range based for loop in C++.
In python I am aware of zip function which does this, but could not find anything like that in C++.