template <class... A1> class Test {
public:
template <class... A2> void print (void(*function)(A2...,A1...)) {
}
};
void test_print (int a, float b, double c) {
}
int main () {
Test<float,double> test;
test.print<int> (&test_print);
}
dGVtcGxhdGUgPGNsYXNzLi4uIEExPiBjbGFzcyBUZXN0IHsKICAgIHB1YmxpYzoKICAgIHRlbXBsYXRlIDxjbGFzcy4uLiBBMj4gdm9pZCBwcmludCAodm9pZCgqZnVuY3Rpb24pKEEyLi4uLEExLi4uKSkgewoKICAgIH0KfTsKCnZvaWQgdGVzdF9wcmludCAoaW50IGEsIGZsb2F0IGIsIGRvdWJsZSBjKSB7Cgp9CgppbnQgbWFpbiAoKSB7CiAgICBUZXN0PGZsb2F0LGRvdWJsZT4gdGVzdDsKICAgIHRlc3QucHJpbnQ8aW50PiAoJnRlc3RfcHJpbnQpOwp9
prog.cpp: In function ‘int main()’:
prog.cpp:14:33: error: no matching function for call to ‘Test<float, double>::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 ..., A1 ...)) [with A2 = {A2 ...}; A1 = {float, double}]
prog.cpp:3:33: note: template argument deduction/substitution failed:
prog.cpp:14:33: note: mismatched types ‘float’ and ‘int’