Move semantics

This is specific to C++. I mentioned that by default, objects are copied when appropriate, e.g. when assigned to a variable. But I should mention that when the object you would copy cannot be accessed in the future, you can implement move semantics that simply “move” the object data to belong to the new variable instead of copying it.

This can happen when you return an object, because it's about to go out of scope. Also when you assign to a temporary like a = b + c, the temporary b + c can be moved into a. That's all the detail I want to go into about that—read a C++ reference if interested [1].