struct MaClasse{ template<class T> void fait() { }}; template<class T>void mafonction(T& t){ t.fait<int>(); //error: expected primary-expression before 'int'} int main(){ MaClasse maclasse; mafonction(maclasse);}
Standard input is empty
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'
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!