C++ Language/Indirection/RvalueReferences/MoveSemantics

Traditionally, a class could provide a "copy-constructor"  and a "copy-assignment operator". These would get used in several situations, such as the definition of  by   (where   had already been defined as a   object). If  is some kind of custom container, then these two functions are usually implemented by deeply copying all contained items, which might be computationally-expensive.

In modern software, these are supplemented by also programming "move-constructor" and "move-assignment operator" functions that are implemented by only transferring a payload handle. Function overloading can distinguish between move-constructor and copy-constructor, because the move-constructor parameter's type is a "rvalue-reference".

Additional information about move-semantics (includes interactive examples)