vendredi 23 septembre 2016

access next vector in 2d vector

I'm trying to access the next root vector in a 2D vector using the auto approach, but I'm getting an error when trying to do so. How would you do this?

int n;
static vector<vector<int>> curr_sizes(n+1, vector<int>());

// Some code to fill the 2D vector with push_backs
for(auto& j:curr_sizes){

        for(auto& k:j){

            // Do something
        }

        // Error on next line

        for(auto& nxt:j+1){

            //Do sometning else

        }
}

Aucun commentaire:

Enregistrer un commentaire