1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
// prms-id: 9206 class X { public: void xtest() { } }; class Y { }; typedef void (X::*Xptr)(); typedef void (Y::*Yptr)(); int main() { X xx; Xptr xp = &X::xtest; Yptr yp = reinterpret_cast<Yptr>(xp); xp = reinterpret_cast<Xptr>(yp); (xx.*xp)(); }