Skip to content

Commit

Permalink
Use LLONG_MAX instead of std::numeric_limits<long long>::max() when c…
Browse files Browse the repository at this point in the history
…onstexpr is absent
  • Loading branch information
andre-nguyen authored and HowardHinnant committed Aug 21, 2020
1 parent d7a0bf1 commit 057b441
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/date/date.h
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,11 @@ struct no_overflow
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<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>
struct mul // overflow == false
Expand Down

0 comments on commit 057b441

Please sign in to comment.