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:
Howard Hinnant
2017-08-15 12:40:03 -04:00
parent 444fa15aa7
commit b639ed5332

View File

@@ -26,7 +26,7 @@
<br/>
<br/>
<a href="mailto:howard.hinnant@gmail.com">Howard E. Hinnant</a><br/>
2017-06-12<br/>
2017-08-15<br/>
</address>
<hr/>
<h1 align=center><code>date</code></h1>
@@ -3005,7 +3005,7 @@ static constexpr year year::min() noexcept;
<blockquote>
<p>
<i>Returns:</i> <code>year{std::numeric_limits&lt;short&gt;::min()}</code>.
<i>Returns:</i> <code>year{-32767}</code>.
</p>
</blockquote>
@@ -3015,7 +3015,7 @@ static constexpr year year::max() noexcept;
<blockquote>
<p>
<i>Returns:</i> <code>year{std::numeric_limits&lt;short&gt;::max()}</code>.
<i>Returns:</i> <code>year{32767}</code>.
</p>
</blockquote>