fork(4) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Demo {
  5. Demo() = delete;
  6. Demo(int _x) : x(_x) { cout << "one-arg constructor" << endl; }
  7. int x;
  8. };
  9.  
  10. int main() {
  11. Demo a(5);
  12. Demo b(a);
  13. return 0;
  14. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
one-arg constructor