[time.traits.is.fp] (original) (raw)

30 Time library [time]

30.4.1 treat_as_floating_point [time.traits.is.fp]

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

The duration template uses the treat_as_floating_point trait to help determine if a duration object can be converted to anotherduration with a different tick period.

Iftreat_as_floating_point_v<Rep> is true, then implicit conversions are allowed among durations.

Otherwise, the implicit convertibility depends on the tick periods of the durations.

[Note 1:

The intention of this trait is to indicate whether a given class behaves like a floating-point type, and thus allows division of one value by another with acceptable loss of precision.

Iftreat_as_floating_point_v<Rep> is false, Rep will be treated as if it behaved like an integral type for the purpose of these conversions.

— _end note_]