This is what I currently have
void test(int& i, float& f) {}
template <class... Ts, class F>
void update(F&& f)
{
//Use Ts here
}
int main()
{
update<int, float>(test);
}
But I need to explicitly call update with <int, float>
because I want to use it for metaprogramming.
It would be nice if this could be deduced automatically from the function
void test(int& i, float& f) {}
template <class... Ts>
void update(std::function<void(Ts&...)> f)
{
//use Ts here
}
int main()
{
//error: no matching function for call to 'update'
update(test);
}