Namespaces
Variants
Views
Actions

std::chrono::treat_as_floating_point

From cppreference.com
< cpp‎ | chrono
Revision as of 14:39, 2 November 2012 by P12bot (Talk | contribs)

 
 
 
 
 

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <chrono>
</td>

<td></td> <td></td> <tr class="t-dcl ">

<td >
template <class Rep>
struct treat_as_floating_point : std::is_floating_point<Rep> {};
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end

The std::chrono::treat_as_floating_point trait helps determine if a duration can be converted to another duration with a different tick period.

Implicit conversions between two durations normally depends on the tick period of the durations. However, implicit conversions can happen regardless of tick period if std::chrono::treat_as_floating_point<Rep>::value == true.