4

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

typedef void * (A:: *B)(char *);
Laurent
  • 812
  • 5
  • 15

2 Answers2

10

Define B as a pointer to member-function of class A, which receives char* and returns void*.

ForEveR
  • 55,233
  • 2
  • 119
  • 133
5

Declare B as the type of signature of member functions of class A getting a char* argument and returning a void* pointer.

I don't feel it is obfuscated. It permits much more readable code. See this answer (for C, but you could adapt it for C++).

Community
  • 1
  • 1
Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547