fork download
  1. #include <iostream>
  2.  
  3. struct X {
  4. void g(std::ostream&) { std::cout << "g"; }
  5. };
  6.  
  7. X* f(X& x)
  8. {
  9. std::cout << "f";
  10. return &x;
  11. }
  12.  
  13. int main()
  14. {
  15. X x;
  16. f(x)->g(std::cout << "a");
  17. }
  18.  
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
afg