fork download
  1. #include <iostream>
  2.  
  3. struct Tod
  4. {
  5. int a;
  6. Tod():a(4){}
  7. ~Tod(){a=0;}
  8. };
  9.  
  10. using namespace std;
  11.  
  12. const Tod& foo()
  13. {
  14. return Tod();
  15. }
  16.  
  17. int main() {
  18. Tod a= foo();
  19. cout<<a.a;
  20. return 0;
  21. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
Standard output is empty