Error[Pe304]: no instance of function "funcA" matches the argument list
argument types are: (int *)
detected during instantiation of "void funcT(T &) [with T=int]"
Код
static void funcA(void *p) {}
template<class T>
void funcT(T &t)
{
funcA(&t);
}
void test()
{
int t;
funcT(t);
}
template<class T>
void funcT(T &t)
{
funcA(&t);
}
void test()
{
int t;
funcT(t);
}
Если убрать квалификатор static у funcA либо вызвать ее напрямую из test, либо сделать funcT не шаблонной, либо просто явно привести тип указателя к void* - все ок.
И Visual C и GCC компилят нормально.