std::chrono::treat_as_floating_point (3) - Linux Manuals
std::chrono::treat_as_floating_point: std::chrono::treat_as_floating_point
NAME
std::chrono::treat_as_floating_point - std::chrono::treat_as_floating_point
Synopsis
Defined in header <chrono>
template <class Rep> (since C++11)
struct treat_as_floating_point : std::is_floating_point<Rep> {};
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.
Helper variable template
template< class Rep > (since C++17)
inline constexpr bool treat_as_floating_point_v = treat_as_floating_point<Rep>::value;
Example
// Run this code
Possible output:
See also