mercredi 29 septembre 2021

Is for( auto it : vect ) required to iterate in vect order? [duplicate]

Can I rely on the following loop to iterate in order:

vector<A> a;
for( auto i : a )
{
    // Does i loop from the first to the last element in a, or i can come in any order?
}

Aucun commentaire:

Enregistrer un commentaire