I would like to declare a variable of type pointer to function returning pointer to function. Essentially what the following does, but without any typedef
s:
typedef void (*func)();
typedef func (*funky_func)();
funky_func ptr;
I tried the following
(void (*)()) (*ptr)();
but it gives an "undeclared identifier"-error for ptr
(probably due to completely different parsing). Being not that well-versed in the intricacies of parsing C++, I'd like to know if this is even possible and if yes, how to do it.
(Please consider this an entirely artificial scenario for the sake of curiosity, without any practical reason. I am perfectly aware that in practice typedef
s are the way to go here, if using function pointers at all.)