Foreach but skip first N items? [duplicate]

  c++, loops, vector

In C++ we have the nice compact way to iterate over a vector:

for(auto& item: myVector) { ... }

Is there any compact form for the same, if I want to iterate over myVector but I need to skip the first N items?

I found a lot of references for skipping only the first item. But I would need to skip more (than 10) items which feels like I need to call next or advance and manually construct the loop.

So, I’m curious if I have any simplier way – if not that’s also an answer.

Source: Windows Questions C++

LEAVE A COMMENT