lundi 2 janvier 2017

Is move semantics just a shallow copy and setting other's pointers to null?

I've been reading about move semantics in C++, and in the explanations people give a lot of analogies to help simplify it, and in my head all I can see is that what people call "moving" as opposed to "copying" is just a shallow copy of the object and setting any pointers in the "moved-from" object to null. Is this basically the gist? Shallow copy and set other's pointers to null?

Aucun commentaire:

Enregistrer un commentaire