tmp/tmpzhwv65jl/{from.md → to.md}
RENAMED
|
@@ -1,47 +0,0 @@
|
|
| 1 |
-
#### `duration_values` <a id="time.traits.duration_values">[[time.traits.duration_values]]</a>
|
| 2 |
-
|
| 3 |
-
``` cpp
|
| 4 |
-
template <class Rep>
|
| 5 |
-
struct duration_values {
|
| 6 |
-
public:
|
| 7 |
-
static constexpr Rep zero();
|
| 8 |
-
static constexpr Rep min();
|
| 9 |
-
static constexpr Rep max();
|
| 10 |
-
};
|
| 11 |
-
```
|
| 12 |
-
|
| 13 |
-
The `duration` template uses the `duration_values` trait to construct
|
| 14 |
-
special values of the durations representation (`Rep`). This is done
|
| 15 |
-
because the representation might be a class type with behavior which
|
| 16 |
-
requires some other implementation to return these special values. In
|
| 17 |
-
that case, the author of that class type should specialize
|
| 18 |
-
`duration_values` to return the indicated values.
|
| 19 |
-
|
| 20 |
-
``` cpp
|
| 21 |
-
static constexpr Rep zero();
|
| 22 |
-
```
|
| 23 |
-
|
| 24 |
-
*Returns:* `Rep(0)`.
|
| 25 |
-
|
| 26 |
-
[*Note 1*: `Rep(0)` is specified instead of `Rep()` because `Rep()` may
|
| 27 |
-
have some other meaning, such as an uninitialized value. — *end note*]
|
| 28 |
-
|
| 29 |
-
*Remarks:* The value returned shall be the additive identity.
|
| 30 |
-
|
| 31 |
-
``` cpp
|
| 32 |
-
static constexpr Rep min();
|
| 33 |
-
```
|
| 34 |
-
|
| 35 |
-
*Returns:* `numeric_limits<Rep>::lowest()`.
|
| 36 |
-
|
| 37 |
-
*Remarks:* The value returned shall compare less than or equal to
|
| 38 |
-
`zero()`.
|
| 39 |
-
|
| 40 |
-
``` cpp
|
| 41 |
-
static constexpr Rep max();
|
| 42 |
-
```
|
| 43 |
-
|
| 44 |
-
*Returns:* `numeric_limits<Rep>::max()`.
|
| 45 |
-
|
| 46 |
-
*Remarks:* The value returned shall compare greater than `zero()`.
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|