I would like to use a function as argument in a variadic template, why does the following not work? How do I make it work?
template<typename F, typename... Args>
F test(F f, const Args&&... args) {
return f(std::forward<Args>(args)...);
}
int simple(int i) {
return i;
}
int main()
{
std::cout << test(simple, 2); // error, 'std::forward': none of the 2 overloads could convert all the argument types
}