Add clock_cast

This commit is contained in:
Howard Hinnant
2017-11-26 20:45:20 -05:00
parent 632d115812
commit 16c5f5885f
2 changed files with 499 additions and 387 deletions

File diff suppressed because it is too large Load Diff

44
tz.html
View File

@@ -1058,7 +1058,7 @@ implicitly access the <code>front()</code> of this list via the
<i>read-only</i> namespace scope functions <code>get_tzdb()</code>, <i>read-only</i> namespace scope functions <code>get_tzdb()</code>,
<code>locate_zone()</code> and <code>current_zone()</code>. Each <code>locate_zone()</code> and <code>current_zone()</code>. Each
<code>vector</code> in <code>tzdb</code> is sorted to enable fast <code>vector</code> in <code>tzdb</code> is sorted to enable fast
lookup. One can iterate over and inspect this database. And lookup. One can iterate over and inspect this database. And
multiple versions of the database can be used at once, via the multiple versions of the database can be used at once, via the
<code>tzdb_list</code>. <code>tzdb_list</code>.
</p> </p>
@@ -2215,7 +2215,7 @@ template &lt;class Duration2, TimeZonePtr&gt;
<blockquote> <blockquote>
<p> <p>
<i>Remarks:</i> Does not participate in overload resolution unless <i>Remarks:</i> Does not participate in overload resolution unless
<code>sys_time&lt;Duration2&gt;</code> is implicitly convertible to <code>sys_time&lt;Duration2&gt;</code> is implicitly convertible to
<code>sys_time&lt;Duration&gt;</code>. <code>sys_time&lt;Duration&gt;</code>.
</p> </p>
<p> <p>
@@ -2324,7 +2324,7 @@ template &lt;class Duration2, TimeZonePtr&gt;
<blockquote> <blockquote>
<p> <p>
<i>Remarks:</i> Does not participate in overload resolution unless <i>Remarks:</i> Does not participate in overload resolution unless
<code>sys_time&lt;Duration2&gt;</code> is implicitly convertible to <code>sys_time&lt;Duration2&gt;</code> is implicitly convertible to
<code>sys_time&lt;Duration&gt;</code>. <code>sys_time&lt;Duration&gt;</code>.
</p> </p>
<p> <p>
@@ -2344,7 +2344,7 @@ template &lt;class Duration2, TimeZonePtr&gt;
<blockquote> <blockquote>
<p> <p>
<i>Remarks:</i> Does not participate in overload resolution unless <i>Remarks:</i> Does not participate in overload resolution unless
<code>sys_time&lt;Duration2&gt;</code> is implicitly convertible to <code>sys_time&lt;Duration2&gt;</code> is implicitly convertible to
<code>sys_time&lt;Duration&gt;</code>. <code>sys_time&lt;Duration&gt;</code>.
</p> </p>
<p> <p>
@@ -2679,10 +2679,10 @@ public:
using time_point = std::chrono::time_point&lt;utc_clock&gt;; using time_point = std::chrono::time_point&lt;utc_clock&gt;;
static constexpr bool is_steady = <i>unspecified</i>; static constexpr bool is_steady = <i>unspecified</i>;
static time_point now() noexcept; static time_point now();
template &lt;class Duration&gt; template &lt;class Duration&gt;
static static
sys_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt; sys_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt;
to_sys(const utc_time&lt;Duration&gt;&amp;); to_sys(const utc_time&lt;Duration&gt;&amp;);
@@ -2715,7 +2715,7 @@ second information. When this is the case, <code>utc_clock</code> will not exis
</p> </p>
<pre> <pre>
static utc_clock::time_point utc_clock::now() noexcept; static utc_clock::time_point utc_clock::now();
</pre> </pre>
<blockquote> <blockquote>
<p> <p>
@@ -2726,7 +2726,7 @@ value of <code>utc_time</code>.
<pre> <pre>
template &lt;typename Duration&gt; template &lt;typename Duration&gt;
static static
sys_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt; sys_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt;
utc_clock::to_sys(const utc_time&lt;Duration&gt;&amp; u); utc_clock::to_sys(const utc_time&lt;Duration&gt;&amp; u);
</pre> </pre>
@@ -2830,16 +2830,16 @@ public:
using time_point = std::chrono::time_point&lt;tai_clock&gt;; using time_point = std::chrono::time_point&lt;tai_clock&gt;;
static constexpr bool is_steady = <i>unspecified</i>; static constexpr bool is_steady = <i>unspecified</i>;
static time_point now() noexcept; static time_point now();
template &lt;class Duration&gt;
static
utc_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt;
to_utc(const std::chrono::time_point&lt;tai_clock, Duration&gt;&amp;) noexcept;
template &lt;class Duration&gt; template &lt;class Duration&gt;
static static
tai_time&lt;std::common_type&lt;Duration, std::chrono::seconds&gt;&gt; utc_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt;
to_utc(const tai_time&lt;Duration&gt;&amp;) noexcept;
template &lt;class Duration&gt;
static
tai_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt;
from_utc(const utc_time&lt;Duration&gt;&amp;) noexcept; from_utc(const utc_time&lt;Duration&gt;&amp;) noexcept;
}; };
@@ -2864,7 +2864,7 @@ second information. When this is the case, <code>tai_clock</code> will not exis
</p> </p>
<pre> <pre>
static tai_clock::time_point tai_clock::now() noexcept; static tai_clock::time_point tai_clock::now();
</pre> </pre>
<blockquote> <blockquote>
<p> <p>
@@ -2875,7 +2875,7 @@ value of <code>tai_time</code>.
<pre> <pre>
template &lt;class Duration&gt; template &lt;class Duration&gt;
static static
utc_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt; utc_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt;
to_utc(const std::chrono::time_point&lt;tai_clock, Duration&gt;&amp; t) noexcept; to_utc(const std::chrono::time_point&lt;tai_clock, Duration&gt;&amp; t) noexcept;
</pre> </pre>
@@ -2891,7 +2891,7 @@ to_utc(const std::chrono::time_point&lt;tai_clock, Duration&gt;&amp; t) noexcept
<pre> <pre>
template &lt;class Duration&gt; template &lt;class Duration&gt;
static static
tai_time&lt;std::common_type&lt;Duration, std::chrono::seconds&gt;&gt; tai_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt;
tai_clock::from_utc(const utc_time&lt;Duration&gt;&amp; t) noexcept; tai_clock::from_utc(const utc_time&lt;Duration&gt;&amp; t) noexcept;
</pre> </pre>
<blockquote> <blockquote>
@@ -2975,10 +2975,10 @@ public:
using time_point = std::chrono::time_point&lt;gps_clock&gt;; using time_point = std::chrono::time_point&lt;gps_clock&gt;;
static constexpr bool is_steady = <i>unspecified</i>; static constexpr bool is_steady = <i>unspecified</i>;
static time_point now() noexcept; static time_point now();
template &lt;class Duration&gt; template &lt;class Duration&gt;
static static
utc_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt; utc_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt;
to_utc(const gps_time&lt;Duration&gt;&amp;) noexcept; to_utc(const gps_time&lt;Duration&gt;&amp;) noexcept;
@@ -3019,7 +3019,7 @@ value of <code>gps_time</code>.
<pre> <pre>
template &lt;class Duration&gt; template &lt;class Duration&gt;
static static
utc_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt; utc_time&lt;std::common_type_t&lt;Duration, std::chrono::seconds&gt;&gt;
gps_clock::to_utc(const gps_time&lt;Duration&gt;&amp; t) noexcept; gps_clock::to_utc(const gps_time&lt;Duration&gt;&amp; t) noexcept;
</pre> </pre>
@@ -3189,7 +3189,7 @@ convert <code>time_point&lt;SourceClock, Duration&gt;</code> to
<code>time_point&lt;SourceClock, Duration&gt;</code> and returns a <code>time_point&lt;SourceClock, Duration&gt;</code> and returns a
<code>time_point&lt;DestClock, <i>some duration</i>&gt;</code> representing an equivalent <code>time_point&lt;DestClock, <i>some duration</i>&gt;</code> representing an equivalent
point in time. A program may specialize <code>clock_time_conversion</code> if at least point in time. A program may specialize <code>clock_time_conversion</code> if at least
one of the template parameters is user-defined clock type. one of the template parameters is user-defined clock type.
</p> </p>
<p> <p>