Remove the integral_cast() function, and replace it with the equivalent safe_cast<integer>().