From 057b441cebc0c9f3c79a1383d068497f1d487d88 Mon Sep 17 00:00:00 2001 From: Andre Nguyen Date: Thu, 20 Aug 2020 22:16:08 -0400 Subject: [PATCH] Use LLONG_MAX instead of std::numeric_limits::max() when constexpr is absent --- include/date/date.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/date/date.h b/include/date/date.h index 14ab796..00b2993 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -1166,7 +1166,11 @@ private: 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 d2 = R2::den / gcd_d1_d2; +#ifdef __cpp_constexpr static const std::intmax_t max = std::numeric_limits::max(); +#else + static const std::intmax_t max = LLONG_MAX; +#endif template struct mul // overflow == false