I'm trying to make a CPP function that takes a function pointer and an arbitrary number of arguments, adds some coordinates, then calls the function pointer as such:
int func_api(void(*fun)(int, int, ...args), ...args) {
fun(this.x, this.y, args);
}
so I can use it as such:
int func(int x, int y, int param1, int param2) {
something;
}
int foo () {
func_api(p1, p2);
}
Is there a way to do this?