This question was asked to me in an interview:
Lets say you have a function which can take any kind of arguments and any number of arguments.
How would you write a template function for the same?
I do not know the exact answer. could anybody suggest?
They checked your awareness of the upcoming C++ standard. The new feature is called “Variadic templates” and looks like this:
For a more complicated examples see, e.g. this tutorial.