I'm trying to do this template instantiation but it's not working. I'm getting the errors:
prog.cpp:7:15: error: template-id 'f<const A&, A()>' for 'void f()' does not match any template declaration
template <class T, T> void f() {}
struct A {};
template void f<const A &, A()>();
int main() {}
This is weird, because when I do it in main it works:
int main() {
const A &a = A(); // no error
}
So why doesn't it work in the template line?