fork(1) download
  1. #include <iostream>
  2.  
  3.  
  4. struct sometype {
  5. sometype() { std::cout << "ctype()" << std::endl; }
  6. ~sometype() { std::cout << "~ctype()" << std::endl; }
  7. };
  8.  
  9. const sometype &foobar( const sometype &cref ) { return cref; }
  10.  
  11. int main()
  12. {
  13. const sometype &cref1 = foobar( sometype() );
  14. sometype &&cref2 = std::move( sometype() );
  15. std::cout << "main continues" << std::endl;
  16. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
ctype()
~ctype()
ctype()
~ctype()
main continues