September 2017
Intermediate to advanced
822 pages
26h 51m
English
One of the most prominent features C++11 introduced was move semantics. You can use it to optimize copying and assignments by moving (“stealing”) internal resources from a source object to a destination object instead of copying those contents. This can be done provided the source no longer needs its internal value or state (because it is about to be discarded).
Move semantics has a significant influence on the design of templates, and special rules were introduced to support move semantics in generic code. This chapter introduces these features.
Suppose you want to write generic code that forwards the basic property of passed arguments:
• Modifyable objects should be forwarded so ...