- Joined
- 2/14/23
- Messages
- 679
- Points
- 223
Title says it all. What is y'alls standard (or THE standard, if there is one) for using const iterators over multiple vectors at once.
The code below seems valid, but doesn't scale well. If the vectors are the same length then you could
- Instantiate them before,
- use one to build the for loop, and
- increment all the iterators at the end of the loop.
The code below seems valid, but doesn't scale well. If the vectors are the same length then you could
- Instantiate them before,
- use one to build the for loop, and
- increment all the iterators at the end of the loop.
for(const_iter1 = vec1.begin() && const_iter2 = vec2.begin(); const_iter1 != vec1.end() ... )
{}