fork(1) download
  1. #include <iostream>
  2.  
  3. class Hoge {
  4. private:
  5. static void f() { std::cout << "hoge" << std::endl; }
  6.  
  7. public:
  8. static void (*get_f())() { return f; }
  9. Hoge() {}
  10. };
  11.  
  12. int main() {
  13. // ordinary
  14. Hoge *hoge = new Hoge();
  15. hoge->get_f()();
  16. delete hoge;
  17. }
  18. /* end */
  19.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
hoge