description | title | ms.date | f1_keywords | helpviewer_keywords | dev_langs | |||
---|---|---|---|---|---|---|---|---|
Learn more about: treat_as_floating_point structure |
treat_as_floating_point Structure |
07/16/2021 |
|
|
|
Checks whether the specified type can be treated as a floating-point type.
template <class T>
struct treat_as_floating_point : is_floating_point<T>;
Helper variable template
template<class T>
inline constexpr bool treat_as_floating_point_v = treat_as_floating_point<T>::value;
T
The type to test.
The purpose 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. If treat_as_floating_point_v<T>
is false, T
will be treated as if it behaves as an integral type for these conversions.
The duration
template uses the treat_as_floating_point trait
to help determine if a duration
object
can be converted to another duration
with a different tick period
.
If treat_as_floating_point_v<T>
is true, implicit conversions are allowed between durations. Otherwise, the implicit convertibility depends on the tick periods of the durations.
Header: <chrono>
Namespace: std::chrono