I read this question here on SO and stumbled over the best voted answer, which used code like this to call a lambda recursively:
std::function
where [
dummy
] is declared
In the declaration that you show. Simplified:
T f /* the declarator */, dummy /* the declarator */;
dummy
is just a name of a variable, just like f
. They are both declared in the same declaration.
Could someone explain what that dummy function (or functor) does
I mean obviously in the example it is used to call the function f. But what its actual purpose?
That is the actual purpose. The only reason it is declared, is so that f
could be called within the same declaration, as was desired in the linked question. The solution is silly, but so is perhaps the desire.