From c3ab69ee0d94b79f568fd95fe80ae746b92b4651 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 15 Aug 2017 12:42:27 -0400 Subject: [PATCH] Hard code year::min(), year::max() to [-32767, 32767] * When year < 0, -year > 0 (always). * These are the minimal limits C places on short. * Reserving -32768 is useful in the implementation. --- date.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/date.h b/date.h index be87f43..8d9e8f3 100644 --- a/date.h +++ b/date.h @@ -1455,7 +1455,7 @@ inline year year::min() NOEXCEPT { - return year{std::numeric_limits::min()+1}; + return year{-32767}; } CONSTCD11 @@ -1463,7 +1463,7 @@ inline year year::max() NOEXCEPT { - return year{std::numeric_limits::max()}; + return year{32767}; } CONSTCD11