From Jason Turner

[time.traits.duration.values]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpqatqz8d3/{from.md → to.md} +47 -0
tmp/tmpqatqz8d3/{from.md → to.md} RENAMED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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() noexcept;
8
+ static constexpr Rep min() noexcept;
9
+ static constexpr Rep max() noexcept;
10
+ };
11
+ ```
12
+
13
+ The `duration` template uses the `duration_values` trait to construct
14
+ special values of the duration’s 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() noexcept;
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() noexcept;
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() noexcept;
42
+ ```
43
+
44
+ *Returns:* `numeric_limits<Rep>::max()`.
45
+
46
+ *Remarks:* The value returned shall compare greater than `zero()`.
47
+