fork download
  1. #include <iostream>
  2.  
  3. struct X { void f() { std::cout << "hello\n"; } };
  4.  
  5. void f(X* p) { p->f(); }
  6.  
  7. struct Y : private X { void g() { ::f(this); }};
  8.  
  9. int main()
  10. {
  11. Y y;
  12. y.g();
  13. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
hello