I have a function that takes 3 arguments. a vector of other functions, a void*, and an arbitrary list of arguments. The function is designed to pass in it's void* and arbitrary list of arguments to each function in the list, which the functions will handle themselves. here is an example of what I want:
typedef void (*fptr)(const void* userdata, ...);
void execute_all(vector<fptr> funcs, void* userdata, ...){
for (int i = 0;i<funcs.size();i++){
fptr func = funcs[i];
//execute func with userdata and ... from above.
//like (*func)(userdata, ...); which obviously doesnt work
}
}
I need to know how to forward all arguments into each function. Dont worry about ensuring compatibility. I handle that elsewhere.
Thanks