fork(3) download
  1. class Foo
  2. {
  3. private:
  4. Foo(int){};
  5.  
  6. public:
  7. static void foo();
  8. };
  9.  
  10. void Foo::foo()
  11. {
  12. Foo f1; //illegal
  13. Foo f2(1); //legal
  14. }
  15.  
  16. int main()
  17. {
  18.  
  19. }
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:12:8: error: no matching function for call to 'Foo::Foo()'
prog.cpp:4:5: note: candidates are: Foo::Foo(int)
prog.cpp:2:1: note:                 Foo::Foo(const Foo&)
stdout
Standard output is empty