C ++ obfuscating typedef declarations

What is the meaning of this declaration? (was given during the interview):

typedef void * (A:: *B)(char *);
+4
source share
2 answers

Define Bas a pointer to a member function of the class Athat receives char*and returns void*.

+10
source

Declare Bas the signature type the member functions of the class A, receiving an argument char*and returning a pointer void*.

I do not feel that he is confused. This allows much more readable code. See this answer (for C, but you can adapt it for C ++).

+5
source

All Articles