fork download
  1. struct S {
  2. void f() {}
  3. };
  4.  
  5. template<typename T>
  6. void call(T* t, void (T::*fn)())
  7. {
  8. (t->*fn)();
  9. delete t;
  10. }
  11.  
  12. int main() {
  13. call(new S, &S::f);
  14. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty