I have the following method
template <int number> methodA(int *x){
blablabla
}
That is called by a number of different methods B,C,D. Each method B,C,D managed a different number of parameters itself
template<int number> methodB(int *x, int* y, int*z){
methodA<number>(x);
}
template<int number> methodC(int *x, int* y){
methodA<number>(x);
}
template<int number> methodD(int *x){
methodA<number>(x);
}
What I want to do is to create a generic caller, such that ideally I could do
genericCaller(methodName, parameterList){
methodName<512>(parameterList);
}
What is the proper procedure for doing this? BTW default parameters are not an option, since these functions are just an example, in reality each method signature is vastly different.
Now that I read about it this is not really a template usage question, but whatever
More like how to pass method names and parameter lists as parameters themselves.
Ps: if possible I'd prefer the solution to be in pure C rather than C++
template <int number> methodA(int *x){
blablabla
}
That is called by a number of different methods B,C,D. Each method B,C,D managed a different number of parameters itself
template<int number> methodB(int *x, int* y, int*z){
methodA<number>(x);
}
template<int number> methodC(int *x, int* y){
methodA<number>(x);
}
template<int number> methodD(int *x){
methodA<number>(x);
}
What I want to do is to create a generic caller, such that ideally I could do
genericCaller(methodName, parameterList){
methodName<512>(parameterList);
}
What is the proper procedure for doing this? BTW default parameters are not an option, since these functions are just an example, in reality each method signature is vastly different.
Now that I read about it this is not really a template usage question, but whatever
Ps: if possible I'd prefer the solution to be in pure C rather than C++