Wouldn't something like this work?
Code:
template<class A, class B, class C, class D>
class FunctStruct
{
public:
void operator=(A (*ptr)(B,C,D))
{
fptr = ptr;
}
A operator()(B b,C c, D d)
{
return fptr(b,c,d);
}
private:
A (*fptr)(B,C,D);
};
////Code could look like this:
int myfunc(char, long, int);
int main()
{
FunctStruct<int,char,long,int> f;
f = myFunc;
f('d',23,1);
}
I haven't compiled this, but something like this should work, although one class for each number of argument would have to be created.