fork(26) download
  1. class Foo
  2. {
  3. public:
  4. Foo() = delete;
  5. private:
  6. Foo(int){};
  7.  
  8. public:
  9. static void foo();
  10. };
  11.  
  12. void Foo::foo()
  13. {
  14. Foo f1; //illegal
  15. Foo f2(1); //legal
  16. }
  17.  
  18. int main()
  19. {
  20.  
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In static member function 'static void Foo::foo()':
prog.cpp:4:5: error: deleted function 'Foo::Foo()'
prog.cpp:14:8: error: used here
stdout
Standard output is empty