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