fork(1) download
  1. #include <iostream>
  2. #include <set>
  3. using namespace std;
  4.  
  5. void foo(set<foobar>);
  6.  
  7. class foobar
  8. {
  9. public:
  10.  
  11. int x;
  12.  
  13. };
  14.  
  15. int main()
  16. {
  17.  
  18. set<foobar> foobar_set;
  19.  
  20. foo(foobar_set);
  21.  
  22.  
  23. }
  24.  
  25. void foo(set<foobar> foobar_set)
  26. {
  27.  
  28. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:5:14: error: ‘foobar’ was not declared in this scope
 void foo(set<foobar>);
              ^
prog.cpp:5:20: error: template argument 1 is invalid
 void foo(set<foobar>);
                    ^
prog.cpp:5:20: error: template argument 2 is invalid
prog.cpp:5:20: error: template argument 3 is invalid
prog.cpp: In function ‘int main()’:
prog.cpp:20:17: error: cannot convert ‘std::set<foobar>’ to ‘int’ for argument ‘1’ to ‘void foo(int)’
   foo(foobar_set);
                 ^
stdout
Standard output is empty