fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct S {
  5. S() {
  6. std::cout << "S()" << std::endl;
  7. }
  8.  
  9. S(const S&) {
  10. std::cout << "S(const S&)" << std::endl;
  11. }
  12.  
  13. ~S() {
  14. std::cout << "~S()" << std::endl;
  15. }
  16. };
  17.  
  18. void f(const S& s) {
  19. std::cout << "f(s)" << std::endl;
  20. }
  21.  
  22. int main() {
  23. f(S());
  24. // your code goes here
  25. return 0;
  26. }
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
S()
f(s)
~S()