Quantcast
Viewing all articles
Browse latest Browse all 40524

Removing items from vectors, using references

I think it might even be possible that elements within braid[i] are being removed properly, but I am not resizing the vector that holds it.

By adding

if(braid[i].size() == 0){
   braid.erase(braid.begin()+i);
}

I seem to actually remove them successfully. Is this a problematic way of handling the vectors?


Viewing all articles
Browse latest Browse all 40524

Trending Articles