fork download
  1. #define GEN(Fun, Ret, Arg1, Arg2, TemplateArgs) \
  2. template<TemplateArgs> \
  3. Ret Fun(Arg1, Arg2) \
  4. { \
  5. return Ret(); \
  6. }
  7.  
  8. GEN(f, int, T, T, typename T);
  9. GEN(g, int, T, U, typename T, typename U);
  10.  
  11. int main()
  12. {
  13. f(5, 7);
  14. g(5, 7.);
  15. }
Compilation error #stdin compilation error #stdout 0s 3292KB
stdin
Standard input is empty
compilation info
prog.cpp:9:41: error: macro "GEN" passed 6 arguments, but takes just 5
 GEN(g, int, T, U, typename T, typename U);
                                         ^
prog.cpp:9:1: error: ‘GEN’ does not name a type
 GEN(g, int, T, U, typename T, typename U);
 ^
prog.cpp: In function ‘int main()’:
prog.cpp:14:9: error: ‘g’ was not declared in this scope
  g(5, 7.);
         ^
stdout
Standard output is empty