fork(1) download
  1. struct MaClasse
  2. {
  3. template<class T>
  4. void fait() { }
  5. };
  6.  
  7. template<class T>
  8. void mafonction(T& t)
  9. {
  10. t.fait<int>(); //error: expected primary-expression before 'int'
  11. }
  12.  
  13. int main()
  14. {
  15. MaClasse maclasse;
  16. mafonction(maclasse);
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'void mafonction(T&)':
prog.cpp:10:12: error: expected primary-expression before 'int'
     t.fait<int>(); //error: expected primary-expression before 'int'
            ^
prog.cpp:10:12: error: expected ';' before 'int'
stdout
Standard output is empty