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 recipe03_examples
- Once the source code is compiled, you can execute each example in this recipe by running the following commands:
> ./recipe03_example01
t = int
t = int
> ./recipe03_example02
t = const int&
> ./recipe03_example03
t = int&
> ./recipe03_example04
t = int&
> ./recipe03_example05
t = int&&
> ./recipe03_example06
t = int&&
> ./recipe03_example07
t = const int&
> ./recipe03_example08
t = const int&&
> ./recipe03_example09
t = int (&&)[6]
In the next section, we will step through each of these examples and explain what each example program does and how it relates to lessons being taught in this recipe.