From the error message, it looks like you are not allowed to accept the address of the expression in parentheses. It means you are rewriting
fPtr = &(myfoo::foo); // main.cpp:14
to
fPtr = &myfoo::foo;
This is due to the specification part (& sect; 5.3.1 / 3) that reads
A pointer to a member is formed only when explicit and used, and its operand is an identifier not enclosed in parentheses <...>
(my emphasis). I'm not sure why this is the rule (and I still didn't know about it until now), but it seems like the compiler is complaining.
Hope this helps!
templatetypedef Aug 20 '11 at 19:44 2011-08-20 19:44
source share