fork download
  1. #include <iostream>
  2.  
  3. struct A
  4. {
  5. int int_;
  6. A()
  7. : int_(42)
  8. {}
  9. operator int& ()
  10. {
  11. return int_;
  12. }
  13. };
  14.  
  15. int main()
  16. {
  17. A a;
  18. std::cin >> a;
  19. std::cout << a;
  20. }
Success #stdin #stdout 0s 2832KB
stdin
77
stdout
77