N-th prime number using C++ template