fork(2) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. struct Foo {
  5. Foo (std::string x) { std::cout << x << std::endl; }
  6. };
  7.  
  8. std::string x("hello, world");
  9.  
  10. int main () { Foo(x); }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:10:20: error: no matching function for call to ‘Foo::Foo()’
 int main () { Foo(x); }
                    ^
prog.cpp:10:20: note: candidates are:
prog.cpp:5:5: note: Foo::Foo(std::string)
     Foo (std::string x) { std::cout << x << std::endl; }
     ^
prog.cpp:5:5: note:   candidate expects 1 argument, 0 provided
prog.cpp:4:8: note: Foo::Foo(const Foo&)
 struct Foo {
        ^
prog.cpp:4:8: note:   candidate expects 1 argument, 0 provided
stdout
Standard output is empty