fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<struct T> void fun(T i)
  5. {
  6. cout<<i<<endl;
  7. }
  8.  
  9. int main()
  10. {
  11. int i=10;
  12. fun<int>(i);
  13. return 0;
  14. }
  15.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4: error: ‘struct T’ is not a valid type for a template constant parameter
prog.cpp: In function ‘void fun(T)’:
prog.cpp:4: error: ‘i’ has incomplete type
prog.cpp:4: error: forward declaration of ‘struct T’
prog.cpp: In function ‘int main()’:
prog.cpp:12: error: no matching function for call to ‘fun(int&)’
stdout
Standard output is empty