The retrieval of the argument types of a function has been discussed multiple times, for instance here and here.
I would like to take this a step further and, for the arguments that specify a default value, get it as well. More specifically, assuming that all the arguments which do not come with a default value can be default constructed, I would like to get a tuple initialized with the default (specified or otherwise constructed) values.
Any chance of doing this in C++? The latest standard is welcomed.
I would like to keep the usual function declarations, but, since I suspect that this is not feasible, a sleek pattern relying on functors could also be acceptable.