tmp/tmpqull3vyo/{from.md → to.md}
RENAMED
|
@@ -5,15 +5,17 @@ template <class Rep> struct treat_as_floating_point
|
|
| 5 |
: is_floating_point<Rep> { };
|
| 6 |
```
|
| 7 |
|
| 8 |
The `duration` template uses the `treat_as_floating_point` trait to help
|
| 9 |
determine if a `duration` object can be converted to another `duration`
|
| 10 |
-
with a different tick `period`. If `
|
| 11 |
-
|
| 12 |
Otherwise, the implicit convertibility depends on the tick `period`s of
|
| 13 |
-
the `duration`s.
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
|
|
|
|
| 5 |
: is_floating_point<Rep> { };
|
| 6 |
```
|
| 7 |
|
| 8 |
The `duration` template uses the `treat_as_floating_point` trait to help
|
| 9 |
determine if a `duration` object can be converted to another `duration`
|
| 10 |
+
with a different tick `period`. If `treat_as_floating_point_v<Rep>` is
|
| 11 |
+
`true`, then implicit conversions are allowed among `duration`s.
|
| 12 |
Otherwise, the implicit convertibility depends on the tick `period`s of
|
| 13 |
+
the `duration`s.
|
| 14 |
+
|
| 15 |
+
[*Note 1*: The intention of this trait is to indicate whether a given
|
| 16 |
+
class behaves like a floating-point type, and thus allows division of
|
| 17 |
+
one value by another with acceptable loss of precision. If
|
| 18 |
+
`treat_as_floating_point_v<Rep>` is `false`, `Rep` will be treated as if
|
| 19 |
+
it behaved like an integral type for the purpose of these
|
| 20 |
+
conversions. — *end note*]
|
| 21 |
|