forked from HowardHinnant/date
Fill out leaps specification
This commit is contained in:
221
d0355r3.html
221
d0355r3.html
@@ -9879,6 +9879,8 @@ Add a new section 23.17.12.10 leap [time.timezone.leap]:
|
|||||||
<pre>
|
<pre>
|
||||||
class leap
|
class leap
|
||||||
{
|
{
|
||||||
|
sys_seconds date_; // exposition only
|
||||||
|
|
||||||
public:
|
public:
|
||||||
leap(const leap&) = default;
|
leap(const leap&) = default;
|
||||||
leap& operator=(const leap&) = default;
|
leap& operator=(const leap&) = default;
|
||||||
@@ -9917,6 +9919,225 @@ insertion. <code>leap</code> is equality and less-than comparable, both with it
|
|||||||
with <code>sys_time<Duration></code>.
|
with <code>sys_time<Duration></code>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
[<i>Example:</i>
|
||||||
|
</p>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
Here is the date of all of the leap second insertions at the time of this writing:
|
||||||
|
</p>
|
||||||
|
<pre>
|
||||||
|
for (auto& l : get_tzdb().leaps)
|
||||||
|
cout << l.date() << '\n';
|
||||||
|
</pre>
|
||||||
|
<p>
|
||||||
|
which outputs:
|
||||||
|
</p>
|
||||||
|
<pre>
|
||||||
|
1972-07-01 00:00:00
|
||||||
|
1973-01-01 00:00:00
|
||||||
|
1974-01-01 00:00:00
|
||||||
|
1975-01-01 00:00:00
|
||||||
|
1976-01-01 00:00:00
|
||||||
|
1977-01-01 00:00:00
|
||||||
|
1978-01-01 00:00:00
|
||||||
|
1979-01-01 00:00:00
|
||||||
|
1980-01-01 00:00:00
|
||||||
|
1981-07-01 00:00:00
|
||||||
|
1982-07-01 00:00:00
|
||||||
|
1983-07-01 00:00:00
|
||||||
|
1985-07-01 00:00:00
|
||||||
|
1988-01-01 00:00:00
|
||||||
|
1990-01-01 00:00:00
|
||||||
|
1991-01-01 00:00:00
|
||||||
|
1992-07-01 00:00:00
|
||||||
|
1993-07-01 00:00:00
|
||||||
|
1994-07-01 00:00:00
|
||||||
|
1996-01-01 00:00:00
|
||||||
|
1997-07-01 00:00:00
|
||||||
|
1999-01-01 00:00:00
|
||||||
|
2006-01-01 00:00:00
|
||||||
|
2009-01-01 00:00:00
|
||||||
|
2012-07-01 00:00:00
|
||||||
|
2015-07-01 00:00:00
|
||||||
|
2017-01-01 00:00:00
|
||||||
|
</pre>
|
||||||
|
</blockquote>
|
||||||
|
<p>
|
||||||
|
— <i>end example</i>]
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
sys_seconds leap::date() const
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>date_</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
bool operator==(const leap& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>x.date() == y.date()</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
bool operator!=(const leap& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>!(x == y)</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
bool operator<(const leap& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>x.date() < y.date()</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
bool operator>(const leap& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>y < x</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
bool operator<=(const leap& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>!(y < x)</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
bool operator>=(const leap& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>!(x < y)</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator==(const const leap& x, const sys_time<Duration>& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>x.date() == y</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator==(const sys_time<Duration>& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>y == x</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator!=(const leap& x, const sys_time<Duration>& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>!(x == y)</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator!=(const sys_time<Duration>& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>!(x == y)</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator< (const leap& x, const sys_time<Duration>& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>x.date() < y</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator< (const sys_time<Duration>& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>x < y.date()</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator> (const leap& x, const sys_time<Duration>& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>y < x</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator> (const sys_time<Duration>& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>y < x</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator<=(const leap& x, const sys_time<Duration>& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>!(y < x)</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator<=(const sys_time<Duration>& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>!(y < x)</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator>=(const leap& x, const sys_time<Duration>& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>!(x < y)</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
template <class Duration> bool operator>=(const sys_time<Duration>& x, const leap& y)
|
||||||
|
</pre>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<i>Returns:</i> <code>!(x < y)</code>.
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p class = note>
|
<p class = note>
|
||||||
|
Reference in New Issue
Block a user