I want to declare a method - variadic - where its signature comes from an "old-style" function signature as template parameter.
You can declare, say, a std::function
using a function signature, e.g.,
std::function<int(float,float)> f;
Now I'd like to have a template which takes a function signature like that and declares a method somehow:
template <typename F>
struct Foo {
[F's-return-type] Method(F's-Arg-pack]...) { ... }
};
So if you instantiate it as follows you get a method as follows:
Foo<int(float,float)> foo;
int x = foo.Method(1.0f, 2.0f);
Or maybe there's a different way to do this?