fork(2) download
  1. #include <iostream>
  2.  
  3. struct C {
  4. C() {}
  5. C(const C&) { std::cout << "A copy was made." << std::endl; }
  6. };
  7.  
  8. C f() {
  9. return C();
  10. }
  11.  
  12. int main() {
  13. std::cout << "Hello World!" << std::endl;
  14. C obj = f();
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
Hello World!