KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
The following code: struct X { void f() {} void g() { auto h = &f; } }; results in: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function. Say â&X::fâ My question is, why is this not allowed and forbidden by the standard? It would be more convenient as a user to refer to it unqualified, so I assume there is some other rationale (safety? an ambiguity? ease of compiler implementation?) for the requirement?
Tags (comma-separated)
Save Edits
Cancel