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