casting member function pointer
问题 I need to use a member function pointer that takes in an argument of base class that used in other code. Well, simply I want do to [something] like the example below. This code works fine, but I wonder if such cast is always safe? I cannot do dynamic or static cast here. #include <cstdio> class C { public: C () : c('c') {} virtual ~C() {} const char c; }; class D : public C { public: D () : d('d') {} virtual ~D() {} const char d; }; class A { public: A () {} virtual ~A() {} void f( C& c ) {