Original Post
I have this code for a functor... it works when I use it the conventional way... but in void main() I'm trying to call the member function with the class name... I can't get it to work. Am I getting the syntax wrong or is it not possible. #include class TX_0 { public: void F(); }; void TX_0::F() { printf("%s\n", __FUNCTION__); } class TX_1 { public: void (TX_0::*FX)(); TX_0 *X; void F_1(); }; void TX_1::F_1() { //All these work... //(X->*FX)(); //(*X.*FX)(); //(this->X->*FX)(); //(*X.*TX_1::FX)(); //(this->X->*TX_1::FX)(); //((*this).X->*TX_1::FX)(); } void main() { TX_0 X_0; TX_1 X_1; X_1.X = &X_0; X_1.FX = &TX_0::F; X_1.F_1(); //this won't work ((X_1).X->*TX_1::FX)(); }