The Variadic Template Parameter Pack
Learn how to use variadic template parameter packs in C++, including constructing them and creating functions like make_string().
The variadic template parameter pack enables programmers to create template functions that can accept any number of arguments.
An example of a function with a variadic number of arguments
If we were to create a function that makes a string out of any number of arguments without variadic template parameter packs, we would need to use C-style variadic arguments (just like printf() does) or create a separate function for every number of arguments:
This is the intended use of our function:
If we require a large number of arguments, this becomes tedious, but with a parameter pack, we can implement this as a function that accepts an ...