In C, From What is guaranteed about the size of a function pointer? it's seems like generic generic function pointers are possible.
Suppose you store the function signature along with the pointer (in a way or another... for example : the size of each parameters), Is it possible to call dynamically this function ? (the signature is only known at runtime). The return type is void for all the function, and only the parameter list changes
I was wondering if casting to a varargs function would do the trick ?
(Bonus) The question is for C, but in C++, is it possible to use a similar techniques, and to apply it on instance methods ?
(I don't expect necessarily standard-compliant solution, but still something that is supported enough by most compilers)