fork download
  1. #define mp_eval(Func) Func::value
  2.  
  3. template<int L, int R>
  4. struct StaticMinimum
  5. {
  6. static const int value = (L < R) ? L : R;
  7. };
  8. // Error: too few arguments for class template "StaticMinimum"
  9. int main()
  10. {
  11. mp_eval((StaticMinimum<9, 12>));
  12. mp_eval(StaticMinimum<9, 12>);
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:12:30: error: macro "mp_eval" passed 2 arguments, but takes just 1
  mp_eval(StaticMinimum<9, 12>);
                              ^
prog.cpp: In function ‘int main()’:
prog.cpp:1:33: error: ‘::value’ has not been declared
 #define mp_eval(Func)       Func::value
                                 ^
prog.cpp:11:2: note: in expansion of macro ‘mp_eval’
  mp_eval((StaticMinimum<9, 12>));
  ^
prog.cpp:12:2: error: ‘mp_eval’ was not declared in this scope
  mp_eval(StaticMinimum<9, 12>);
  ^
stdout
Standard output is empty