August 2020
Beginner to intermediate
653 pages
16h 55m
English
In Exploration 40, I introduced std::move() without explaining what it really does or how it works. Somehow it moves data, such as a string, from one variable to another, instead of copying the string contents, but you must be wondering how it works its wonders. The function itself is surprisingly simple. The concepts that underlie that simple implementation are more complicated, which is why I have waited until now to introduce the complexities and subtleties involved.
As you know, the std::vector type stores an array of values. As you add more values to the vector, ...