I have a `std::vector<std::unique_ptr<object>> myObjects_ptrs`. I need to, starting in one of my objects, circle back again to where I started.

I am doing this as follows:

```cpp
while(true)
{
    for(int i = 0; i < myObjects_ptrs.size(); ++i)
    {
        myObjects_ptr[i]->doSomething();
        //and here I need to circle back
        for(int j = i + 1; j < myObjects_ptr.size(); ++j)
        {
            //do some things with each other object
        }
        for(int j = 0; j < i; ++j)
        {
            //do the same things with the rest of the objects
        }
    }
}

```

Is this the standard way of doing that? My problem is that once I detect something, then I dont need to keep going around. For example if I find something during the first loop then there is no need to go through the second loop. I con solve this by adding an extra `if` before the second loop; but is there a better way?