forked from HowardHinnant/date
Reword is_clock and add is_clock_v
This commit is contained in:
34
d0355r3.html
34
d0355r3.html
@@ -37,7 +37,7 @@
|
|||||||
Document number: D0355R3<br/>
|
Document number: D0355R3<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<a href="mailto:howard.hinnant@gmail.com">Howard E. Hinnant</a><br/>
|
<a href="mailto:howard.hinnant@gmail.com">Howard E. Hinnant</a><br/>
|
||||||
2017-06-16<br/>
|
2017-06-17<br/>
|
||||||
</address>
|
</address>
|
||||||
<hr/>
|
<hr/>
|
||||||
<h1>Extending <code><chrono></code> to Calendars and Time Zones</h1>
|
<h1>Extending <code><chrono></code> to Calendars and Time Zones</h1>
|
||||||
@@ -805,6 +805,7 @@ namespace chrono {
|
|||||||
// ...
|
// ...
|
||||||
|
|
||||||
template <class T> struct is_clock;
|
template <class T> struct is_clock;
|
||||||
|
template <class T> inline constexpr bool is_clock_v = is_clock<T>::value;
|
||||||
|
|
||||||
// duration I/O
|
// duration I/O
|
||||||
template <class charT, class traits, class Rep, class Period>
|
template <class charT, class traits, class Rep, class Period>
|
||||||
@@ -1571,22 +1572,29 @@ template <class T> struct is_clock;
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<code>is_clock</code> is a type property query trait that publicly derives from
|
<code>is_clock</code> is a <code>UnaryTypeTrait</code> ([meta.rqmts]) with a base
|
||||||
<code>true_type</code> if <code>T</code> meets the Clock requirements ([time.clock.req]),
|
characteristic of <code>true_type</code> if <code>T</code> meets the <code>Clock</code>
|
||||||
else it derives from <code>false_type</code>. For the purposes of the specification of
|
requirements ([time.clock.req]), otherwise <code>false_type</code>. For the purposes of
|
||||||
this trait, <code>T</code> meets the clock requirements if it has all of the following
|
the specification of this trait, the extent to which an implementation determines that a
|
||||||
properties:
|
type cannot meet the clock requirements is unspecified, except that as a minimum a type
|
||||||
|
<code>T</code> shall not qualify as a clock unless it satisfies all of the following
|
||||||
|
conditions:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Has a nested type named <code>rep</code>.</li>
|
<li>the <i>qualified-id</i>s <tt>T::rep</tt>, <tt>T::period</tt>,
|
||||||
<li>Has a nested type named <code>period</code>.</li>
|
<tt>T::duration</tt>, and <tt>T::time_point</tt> are (all) valid and
|
||||||
<li>Has a nested type named <code>duration</code>.</li>
|
each denotes a type ([temp.deduct]),</li>
|
||||||
<li>Has a nested type named <code>time_point</code>.</li>
|
<li>the expression <tt>T::is_steady</tt> is well-formed when treated as
|
||||||
<li>Has a static data member named <code>is_steady</code>.</li>
|
an unevaluated operand,</li>
|
||||||
<li>Has a static member function named <code>now</code> with zero parameters.</li>
|
<li>the expression <tt>T::now()</tt> is well-formed when treated as an
|
||||||
|
unevaluated operand.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The behavior of a program that adds specializations for <code>is_clock</code> is undefined.
|
||||||
|
</p>
|
||||||
|
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<a name="time.duration.io"></a><p class = note>
|
<a name="time.duration.io"></a><p class = note>
|
||||||
@@ -10273,7 +10281,7 @@ requirements. If a template parameter is named <code>Predicate</code>,
|
|||||||
<code>operator()</code> applied to the template argument shall return a value that is
|
<code>operator()</code> applied to the template argument shall return a value that is
|
||||||
convertible to <code>bool</code>. <ins>A program that instantiates a template with a
|
convertible to <code>bool</code>. <ins>A program that instantiates a template with a
|
||||||
template parameter named <code>Clock</code> with a type for which
|
template parameter named <code>Clock</code> with a type for which
|
||||||
<code>chrono::is_clock<Clock>::value</code> is <code>false</code>, is ill-formed.
|
<code>chrono::is_clock_v<Clock></code> is <code>false</code>, is ill-formed.
|
||||||
</p>
|
</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user