Perform the following steps to try this recipe:
- From a new Terminal, run the following command to download the source code:
> cd ~/
> git clone https://github.com/PacktPublishing/Advanced-CPP-CookBook.git
> cd Advanced-CPP-CookBook/chapter12
- To compile the source code, run the following command:
> cmake .
> make recipe04_examples
- Once the source code is compiled, you can execute each example in this recipe by running the following commands:
> ./recipe04_example01
t = int
t = int
> ./recipe04_example02
t = int&
> ./recipe04_example03
t = int&&
t = int&&
> ./recipe04_example04
t = int&&
u = int&
> ./recipe04_example05
t = int&&
> ./recipe04_example06
t = const char (&)[16]
u = int&&
In the next section, we will step through each of these examples and explain what each example program does and how it relates to the lessons being taught in this recipe.