fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T, typename T2>
  5. class class1
  6. {
  7. public:
  8. bool fun()
  9. {
  10. return T2(int x);
  11. }
  12. };
  13.  
  14.  
  15. int main() {
  16. // your code goes here
  17. return 0;
  18.  
  19. class1 test;
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In member function ‘bool class1<T, T2>::fun()’:
prog.cpp:10:12: error: expected primary-expression before ‘(’ token
   return T2(int x);
            ^
prog.cpp:10:13: error: expected primary-expression before ‘int’
   return T2(int x);
             ^~~
prog.cpp: In function ‘int main()’:
prog.cpp:19:9: error: missing template arguments before ‘test’
  class1 test;
         ^~~~
stdout
Standard output is empty