To illustrate:
struct MyFunc { template void doIt() { cout << N << endl; } }; template
You have to tell the compiler that doIt will be a template:
doIt
f.template doIt<123>();