c++14 iterate over vector code example
Example 1: c++ iterate over vector
for(auto const& value: a) {
/* std::cout << value; ... */
}
Example 2: iterate over 2 vectors c++
for (auto& [a, b] : zip(containerA, containerB)) {
a = b;
}
for(auto const& value: a) {
/* std::cout << value; ... */
}
for (auto& [a, b] : zip(containerA, containerB)) {
a = b;
}