forked from HowardHinnant/date
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.
This commit is contained in:
4
date.h
4
date.h
@@ -1455,7 +1455,7 @@ inline
|
|||||||
year
|
year
|
||||||
year::min() NOEXCEPT
|
year::min() NOEXCEPT
|
||||||
{
|
{
|
||||||
return year{std::numeric_limits<short>::min()+1};
|
return year{-32767};
|
||||||
}
|
}
|
||||||
|
|
||||||
CONSTCD11
|
CONSTCD11
|
||||||
@@ -1463,7 +1463,7 @@ inline
|
|||||||
year
|
year
|
||||||
year::max() NOEXCEPT
|
year::max() NOEXCEPT
|
||||||
{
|
{
|
||||||
return year{std::numeric_limits<short>::max()};
|
return year{32767};
|
||||||
}
|
}
|
||||||
|
|
||||||
CONSTCD11
|
CONSTCD11
|
||||||
|
Reference in New Issue
Block a user