vendredi 29 janvier 2016

Do STL containers do smart deallocation like shared_ptr?

Are STL containers smart like shared_ptr?

They do deallocate on their own when out of scope, but what about assignment operations?

vector<int> aa(9);
...fill aa...
vector<int> bb;
aa = bb;

Did the assignment operation deallocate properly everything that was in aa?

Aucun commentaire:

Enregistrer un commentaire