Professional Documents
Culture Documents
CSCE 121: Rule of Three Good For Memory Management
CSCE 121: Rule of Three Good For Memory Management
BOTH: have parameter of constant reference to source object of same type, allocate
new memory and copy data from source
MOVE SEMANTICS:
Move Constructor and Move Assignment do same thing as Copy, excepts Move does not
allocate new memory or copy data from a source
Important because of efficiency since instead of copying something that will be
destroyed, we are moving its value to something that will live (Lvalue)