How difficult would it be to make partial specializations work:
// Write n*pi once for every possible type template<typename Tp, std::size_t N> constexpr Tp npi = N * Tp(3.1415926535897932385L); // Partial specialization for int type. template<std::size_t N> constexpr double npi<int, N> = N * double(3.1415926535897932385L);