fork download
  1. template <typename T>
  2. void CallFn(T *p, void (T::*pfn)(void))
  3. {
  4. (p->*pfn)();
  5. }
  6. class Foo
  7. {
  8. public:
  9. void Bar(void){}
  10. };
  11.  
  12.  
  13. int main(int argc, char** argv)
  14. {
  15. Foo *p = new Foo();
  16. CallFn(p, &Foo::Bar);
  17. }
Success #stdin #stdout 0s 3024KB
stdin
Standard input is empty
stdout
Standard output is empty