I have a typedef something like this:
typedef std::function<int arg1, float arg2> MyFunction;
And somewhere in my code it is used like this:
MyFunction func = [](int arg1, float arg2){ };
The fact is that every time I change the number of arguments to a function (for example, I add a third argument, arg arg3), I have to update it errywhere throughout my code where I used MyFunction (even if these arguments are not used at all.
And I'm too lazy to do this. Is there a way to get the argument list from std :: function from this type? (I mean), so creating a function might look like this:
MyFunction func = [](MyFunction::args){ };
source
share