fork download
  1. template <typename... Args>
  2. struct A
  3. {
  4. template <Args...>
  5. void f() {}
  6. };
  7.  
  8. int main()
  9. {
  10. A<int, bool> a;
  11. a.f<1,true>();
  12. }
  13.  
Compilation error #stdin compilation error #stdout 0s 2848KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:11:17: error: wrong number of template arguments (2, should be 1)
prog.cpp:11:17: error: no matching function for call to ‘A<int, bool>::f()’
prog.cpp:11:17: note: candidate is:
prog.cpp:5:10: note: template<Args ...<anonymous> > void A::f() [with Args ...<anonymous> = {<unnamed> ...}; Args = {int, bool}]
prog.cpp:5:10: note:   substitution of deduced template arguments resulted in errors seen above
stdout
Standard output is empty