Why does this fail to compile? (g++-4.5)
template < typename U > static void h () { } int main () { auto p = &h; // error: p has inco
It does not compile because type of 'p' is not known to the compiler which is a must in C++ unlike some other languages.
Try
template < typename U > static void h () { } int main () { auto void (*p)() = &h; }