fork download
  1. #include <iostream>
  2. using std::cout;
  3. using std::endl;
  4. struct X
  5. {
  6. X() { cout << "Ctor" << endl; }
  7. X(const X&) { cout << "Copy-ctor" << endl; }
  8. operator X() { cout << "operator" << endl; }
  9. };
  10.  
  11. int main()
  12. {
  13. X x;
  14. X y(x);
  15. X z = x;
  16. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
Ctor
Copy-ctor
Copy-ctor