+1  A: 

You're simply not calling the f() function in your recursive call, you're trying to "call the object":

You write:

TestDispatcher2D<...> t;
return t(m,n);

But you want:

TestDispatcher2D<...> t;
return t.f(m,n);
sth
You can also write TestDispatcher2D<...>().f(mn, n)
Edouard A.
That's it. Thanks. I was trying to use some operator() tricks earlier and missed that fix.
Mr Fooz
You could even make f static, so you don't need to construct a temporary object at all.
sth
@sth: you are correct, thanks for the suggestion
Mr Fooz