fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class C{
  6. private:
  7. public:
  8. C(){cout << "C0 " ;};
  9. C(const C&) { cout << "CC ";};
  10. C& operator= (const C&) { cout << "O= "; return *this;};
  11. };
  12.  
  13. C fun(C a) { return a;}
  14.  
  15. int main(){
  16. C c;
  17. cout << endl;
  18. fun(c);
  19. cout << endl;
  20. C y = fun(c);
  21. cout << endl;
  22. C z; z = fun(c);
  23. cout << endl;
  24. fun(fun(c));
  25. }
  26.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
C0 
CC CC 
CC CC 
C0 CC CC O= 
CC CC CC