In this recipe, we will learn how the compiler handles the auto keyword, specifically for type deduction. This recipe is important because how auto is handled is not intuitive, and without a clear understanding of how auto works, your code will likely contain bugs and performance issues. The topics included in this recipe have a general description of auto, type deduction, forwarding (or universal) references, l-values, and r-values.
Using auto and type deduction
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 cmake
This will ensure your operating...