There are plenty of questions about how to call a variadic function with the elements of a tuple. e.g: How do I expand a tuple into variadic template function's arguments? My problem is a bit different:
I have a family of functions:
void f(int arg1);
void f(int arg1, int arg2);
...
I'd like a template:
template<size_t Arity>
void call(std::vector<int> args) {
???
}
That calls the appropriate f
with args[0], args[1]...