lundi 8 octobre 2018

Is it necessary to reset std::list after been moved?

I've got following code:

std::list some_data;
...
std::list new_data = std::move(some_data);
some_data.clear();
...

The question is whether some_data.clear() is necessary? (for the record, some_data will be reused in the future)

Aucun commentaire:

Enregistrer un commentaire