Compile time integer square root for large numbers
Since you're on a C++14 compiler, the simplest solution is just to stick constexpr in front of your runtime algorithm:

template &lt;typename T&gt;
constexpr T rt_square_root(T num)
{
    /* exact same code as before */
}

static_assert( rt_square_root(N_1 * N_1) == N_1, "bad square root" );


I'm not sure there's a compelling reason to do it any other way.