How to get the address of an overloaded member function?
问题 I'm trying to get a pointer to a specific version of an overloaded member function. Here's the example: class C { bool f(int) { ... } bool f(double) { ... } bool example() { // I want to get the "double" version. typedef bool (C::*MemberFunctionType)(double); MemberFunctionType pointer = &C::f; // <- Visual C++ complains } }; The error message is "error C2440: 'initializing' : cannot convert from 'overloaded-function' to 'MemberFunctionType'" This works if f is not overloaded, but not in the