fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct X
  5. {
  6. X()
  7. {}
  8.  
  9. X(X&&)
  10. {}
  11. };
  12.  
  13. int main()
  14. {
  15. X a;
  16. X b = a;
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:16:8: error: use of deleted function ‘constexpr X::X(const X&)’
  X b = a;
        ^
prog.cpp:4:8: note: ‘constexpr X::X(const X&)’ is implicitly declared as deleted because ‘X’ declares a move constructor or move assignment operator
 struct X
        ^
stdout
Standard output is empty