fork download
  1. class Test {
  2. public:
  3. template <class... A2> void print (void(*function)(A2...,float,double)) {
  4.  
  5. }
  6. };
  7.  
  8. void test_print (int a, float b, double c) {
  9.  
  10. }
  11.  
  12. int main () {
  13. Test test;
  14. test.print<int> (&test_print);
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:14:33: error: no matching function for call to ‘Test::print(void (*)(int, float, double))’
prog.cpp:14:33: note: candidate is:
prog.cpp:3:33: note: template<class ... A2> void Test::print(void (*)(A2 ..., float, double))
prog.cpp:3:33: note:   template argument deduction/substitution failed:
prog.cpp:14:33: note:   mismatched types ‘float’ and ‘int’
stdout
Standard output is empty