fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct X
  6. {
  7. X(const X&) { cout << "copy" << endl; }
  8. X(X&&) { cout << "move" << endl; }
  9.  
  10. template<class T> X(const T&) { cout << "tmpl" << endl; }
  11. };
  12.  
  13. int main()
  14. {
  15. X x1 = 42;
  16. X x2(x1);
  17. }
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
tmpl
copy