This is what I\'m trying to do:
// base case
void f() {}
template
void f() {
Since class templates can be partially specialized, another possibility is to use class templates to do the work, and have your function delegate to them:
template
struct caller
{
static void call() { } // Base case, terminates recursion
};
template
struct caller
{
static void call()
{
// Do something with T
caller::call();
}
};
template
void f() {
caller::call();
}