There is a function
template <class ...T>
void foo(std::function<void(T...)> callback);
to which I pass the callback.
I would like to do something like
foo(bar);
where baris for example
void bar(int a, long b, double c, float d);
but it gives me
error: no matching function for call to bar(void (&)(int, long int, double, float))
I need to call foohow
foo(std::function<void(int, long, double, float)>(bar));
which is too verbose. Even
foo<int, long, double, float>(bar);
would be better.
foo(bar);
will be just perfect.
In any case, how can I make the calls fooless detailed?
AnnouncementEdit: foo should remain unchanged.
source
share