I'm looking for something that will let me do this:
1 2 3 4 5 6 7
using f1_t = void (int, int);
using f2_t = bool (int, int);
//...
Register_f1(std::autofunc<f1_t>::func); //register callback that does nothing
Register_f2(std::autofunc<f2_t, true>::func); //register callback that always returns true
Is there some way that I can make std::autofunc, or is there something similar that already exists? I just want to give it a function prototype and a default return value and have it give me a function or function pointer that ignores all its arguments and returns the default value.
The reason I ask is because I have a lot of callbacks and they have lengthy parameter lists, and I was thinking that there should be a better way than making do-nothing functions for every one of them.
If there's no way to do it, that's fine, I'm just double checking.