fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class X {
  5. int a;
  6. void operator=(X) = delete;
  7. };
  8.  
  9.  
  10. int main() {
  11.  
  12. X a, b;
  13.  
  14. a = b;
  15. // your code goes here
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:6:8: error: 'void X::operator=(X)' is private
   void operator=(X) = delete;
        ^
prog.cpp:14:4: error: within this context
  a = b;
    ^
prog.cpp:14:4: error: use of deleted function 'void X::operator=(X)'
prog.cpp:6:8: note: declared here
   void operator=(X) = delete;
        ^
stdout
Standard output is empty