问题
C++ permits function pointers and function references. It also permits pointers-to-member-functions.
But does it permit references-to-member-functions?
I can't seem to deduce the rules from the standard, and I've failed to make a program work with them.
[ member function pointers ] [ member function references ]
回答1:
[C++11: 8.3.3/3]:
A pointer to member shall not point to a static member of a class (9.4), a member with reference type, or “cv void.” [ Note: See also 5.3 and 5.5. The type “pointer to member” is distinct from the type “pointer”, that is, a pointer to member is declared only by the pointer to member declarator syntax, and never by the pointer declarator syntax. There is no “reference-to-member” type in C++. —end note ]
来源:https://stackoverflow.com/questions/8508266/does-c-support-member-function-references