Variadic Templates
We just saw how we can write a template that accepts parameters independently from their ref-ness.
But the two functions we talked about from the standard library, std::invoke and std::async, have an additional property: they can accept any number of arguments.
In a similar way, std::tuple, a type similar to a std::array but that can contain values of different types, can contain an arbitrary number of types.
How is it possible for a template to accept an arbitrary number of arguments of different types?
In the past, a solution to this problem was to provide a great number of overloads for the same function, or multiple implementations of the class or struct, one for each number of the parameters.
This is clearly code that is not easy to maintain, as it forces us to write the same code multiple times. Another drawback is that there is a limit to the number of template parameters, so if your code requires more parameters than what is provided, you do not have a way to use the...