template<int N> 
void foo() {
  foo<N - 1>();
}

template<>
void foo<0>() {
}

int main () {
  //add a call to foo
}

