fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct test{
  5. void myTest(){ cout << "Hey-O\n"; }
  6. void (test::*result())(){ return reinterpret_cast<void (test::*)()>(&test::myTest); }
  7. };
  8.  
  9. int main() {
  10. test bar;
  11.  
  12. (bar.*bar.result())();
  13. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Hey-O