samedi 31 octobre 2015

Why does C++ move semantics leave the source constructed?

In C++11, "move semantics" was introduced, implemented via the two special members: move constructor and move assignment. Both of these operations leave the moved-from object constructed.

Wouldn't it have been better to leave the source in a destructed state? Isn't the only thing you can do with a moved-from object is destruct it anyway?

Aucun commentaire:

Enregistrer un commentaire