July 2019
Intermediate to advanced
308 pages
9h 32m
English
This section explains move(), move_if_noexcept(), forward(), swap(), and exchange(). In passing, we also introduce the concepts of move semantics and perfect forwarding.
An object can be moved elsewhere (rather than copied) if its previous user no longer needs it afterward. Moving the resources from one object to another can often be implemented far more efficiently than (deep) copying them. For a string object, for instance, moving is typically as simple ...
Read now
Unlock full access