fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<typename T>
  5. void foo (T& a)
  6. {
  7. }
  8.  
  9. int main() {
  10. foo(3);
  11. return 0;
  12. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:10:7: error: invalid initialization of non-const reference of type ‘int&’ from an rvalue of type ‘int’
  foo(3);
       ^
prog.cpp:5:6: error: in passing argument 1 of ‘void foo(T&) [with T = int]’
 void foo (T& a)
      ^
stdout
Standard output is empty