In this recipe, we will learn why a move constructor or operator should never be marked const (and why a copy constructor/operator is always marked as const). This is important because it gets to the heart of the difference between a move and a copy. Move semantics in C++ is one of its most powerful features and understanding why it is so important and what it is actually doing is critical to writing good C++ code.
Learning to be wary of const&&
Getting ready
Before beginning, please ensure that all of the technical requirements are met, including installing Ubuntu 18.04 or higher and running the following in a Terminal window:
> sudo apt-get install build-essential git
This will ensure your operating system has...