こういう事なのかなと。
#include <iostream> using namespace std; class Test { public: void Func1() { cout << "Func1" << endl; } void Func2() { cout << "Func2" << endl; } void Exec( void (Test::*hoge)() ) { (this->*hoge)(); } }; void TestFunc() { Test test; test.Exec( &Test::Func1 ); test.Exec( &Test::Func2 ); }
「->」の右に来るのがポインタだっていうことをあまり意識してなかったなぁと気付いた次第です。
Functorとか使うときに使ってはいたんだけどなぁ。