The closest equivalent is a range based for-loop. For example,
auto y = {0, 1, 2, 3, 4, 5, 6};
for (auto i : y)
{
// do something with i
}
There are more details, but these depend on what you want to do. The C++ semantics are quite different to python's.