• Source
    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.