fork(5) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Q
  5. {
  6. int w;
  7. public:
  8. Q():w(19){};
  9. Q(const Q&) = delete;
  10. Q& operator = (const Q&) = delete;
  11.  
  12. static Q sQ;
  13. };
  14.  
  15. Q Q::sQ = Q();
  16.  
  17. int main() {
  18. // your code goes here
  19. return 0;
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:15:13: error: use of deleted function 'Q::Q(const Q&)'
 Q Q::sQ = Q();
             ^
prog.cpp:9:2: note: declared here
  Q(const Q&) = delete;
  ^
stdout
Standard output is empty