Note: Until proven wrong, I do not think that the va_list system for "varying number-of-arguments" type function is a viable solution. How is the va_list system constructed anyway?
There is no such concept as generic function pointer, because generic function is declaration.
For example there cannot be class pointer , you can create pointer to object but not pointer on class because class is only declaration for compilator.
So you cannot create pointer on generic function, you can create pointer on instance function.
Pointer is object that keeps address of another object, but for example generic function does not appear in stack.
Edit: probably there is some good boost or even std libs, that do the exact same thing, but this was more fun =)
Edit2: This could (probably) be "improved" further to use perfect forwarding.
Whoa, that's a good one. Although I probably don't fully understand the principles of variable argument functions, it looks like it should do the trick. Gonna test to see the idea in action.
Thanks for the fast answers.