Use LLONG_MAX instead of std::numeric_limits<long long>::max() when constexpr is absent

This commit is contained in:
Andre Nguyen 2020-08-20 22:16:08 -04:00 committed by Howard Hinnant
parent d7a0bf1fa7
commit 057b441ceb

View File

@ -1166,7 +1166,11 @@ private:
static const std::intmax_t d1 = R1::den / gcd_d1_d2; static const std::intmax_t d1 = R1::den / gcd_d1_d2;
static const std::intmax_t n2 = R2::num / gcd_n1_n2; static const std::intmax_t n2 = R2::num / gcd_n1_n2;
static const std::intmax_t d2 = R2::den / gcd_d1_d2; static const std::intmax_t d2 = R2::den / gcd_d1_d2;
#ifdef __cpp_constexpr
static const std::intmax_t max = std::numeric_limits<std::intmax_t>::max(); static const std::intmax_t max = std::numeric_limits<std::intmax_t>::max();
#else
static const std::intmax_t max = LLONG_MAX;
#endif
template <std::intmax_t Xp, std::intmax_t Yp, bool overflow> template <std::intmax_t Xp, std::intmax_t Yp, bool overflow>
struct mul // overflow == false struct mul // overflow == false