From Jason Turner

[time.duration.nonmember]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp_ccreh81/{from.md → to.md} +16 -13
tmp/tmp_ccreh81/{from.md → to.md} RENAMED
@@ -1,9 +1,9 @@
1
- #### `duration` non-member arithmetic <a id="time.duration.nonmember">[[time.duration.nonmember]]</a>
2
 
3
- In the function descriptions that follow, `CD` represents the return
4
- type of the function. `CR(A, B)` represents `common_type_t<A, B>`.
5
 
6
  ``` cpp
7
  template<class Rep1, class Period1, class Rep2, class Period2>
8
  constexpr common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>>
9
  operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
@@ -23,55 +23,58 @@ template <class Rep1, class Period1, class Rep2, class Period2>
23
  template<class Rep1, class Period, class Rep2>
24
  constexpr duration<common_type_t<Rep1, Rep2>, Period>
25
  operator*(const duration<Rep1, Period>& d, const Rep2& s);
26
  ```
27
 
28
- *Remarks:* This operator shall not participate in overload resolution
29
- unless `Rep2` is implicitly convertible to `CR(Rep1, Rep2)`.
30
 
31
  *Returns:* `CD(CD(d).count() * s)`.
32
 
33
  ``` cpp
34
  template<class Rep1, class Rep2, class Period>
35
  constexpr duration<common_type_t<Rep1, Rep2>, Period>
36
  operator*(const Rep1& s, const duration<Rep2, Period>& d);
37
  ```
38
 
39
- *Remarks:* This operator shall not participate in overload resolution
40
- unless `Rep1` is implicitly convertible to `CR(Rep1, Rep2)`.
41
 
42
  *Returns:* `d * s`.
43
 
44
  ``` cpp
45
  template<class Rep1, class Period, class Rep2>
46
  constexpr duration<common_type_t<Rep1, Rep2>, Period>
47
  operator/(const duration<Rep1, Period>& d, const Rep2& s);
48
  ```
49
 
50
- *Remarks:* This operator shall not participate in overload resolution
51
- unless `Rep2` is implicitly convertible to `CR(Rep1, Rep2)` and `Rep2`
52
- is not a specialization of `duration`.
53
 
54
  *Returns:* `CD(CD(d).count() / s)`.
55
 
56
  ``` cpp
57
  template<class Rep1, class Period1, class Rep2, class Period2>
58
  constexpr common_type_t<Rep1, Rep2>
59
  operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
60
  ```
61
 
 
 
 
62
  *Returns:* `CD(lhs).count() / CD(rhs).count()`.
63
 
64
  ``` cpp
65
  template<class Rep1, class Period, class Rep2>
66
  constexpr duration<common_type_t<Rep1, Rep2>, Period>
67
  operator%(const duration<Rep1, Period>& d, const Rep2& s);
68
  ```
69
 
70
- *Remarks:* This operator shall not participate in overload resolution
71
- unless `Rep2` is implicitly convertible to `CR(Rep1, Rep2)` and `Rep2`
72
- is not a specialization of `duration`.
73
 
74
  *Returns:* `CD(CD(d).count() % s)`.
75
 
76
  ``` cpp
77
  template<class Rep1, class Period1, class Rep2, class Period2>
 
1
+ ### Non-member arithmetic <a id="time.duration.nonmember">[[time.duration.nonmember]]</a>
2
 
3
+ In the function descriptions that follow, unless stated otherwise, let
4
+ `CD` represent the return type of the function.
5
 
6
  ``` cpp
7
  template<class Rep1, class Period1, class Rep2, class Period2>
8
  constexpr common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>>
9
  operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
 
23
  template<class Rep1, class Period, class Rep2>
24
  constexpr duration<common_type_t<Rep1, Rep2>, Period>
25
  operator*(const duration<Rep1, Period>& d, const Rep2& s);
26
  ```
27
 
28
+ *Constraints:*
29
+ `is_convertible_v<const Rep2&, common_type_t<Rep1, Rep2>>` is `true`.
30
 
31
  *Returns:* `CD(CD(d).count() * s)`.
32
 
33
  ``` cpp
34
  template<class Rep1, class Rep2, class Period>
35
  constexpr duration<common_type_t<Rep1, Rep2>, Period>
36
  operator*(const Rep1& s, const duration<Rep2, Period>& d);
37
  ```
38
 
39
+ *Constraints:*
40
+ `is_convertible_v<const Rep1&, common_type_t<Rep1, Rep2>>` is `true`.
41
 
42
  *Returns:* `d * s`.
43
 
44
  ``` cpp
45
  template<class Rep1, class Period, class Rep2>
46
  constexpr duration<common_type_t<Rep1, Rep2>, Period>
47
  operator/(const duration<Rep1, Period>& d, const Rep2& s);
48
  ```
49
 
50
+ *Constraints:*
51
+ `is_convertible_v<const Rep2&, common_type_t<Rep1, Rep2>>` is `true` and
52
+ `Rep2` is not a specialization of `duration`.
53
 
54
  *Returns:* `CD(CD(d).count() / s)`.
55
 
56
  ``` cpp
57
  template<class Rep1, class Period1, class Rep2, class Period2>
58
  constexpr common_type_t<Rep1, Rep2>
59
  operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
60
  ```
61
 
62
+ Let `CD` be
63
+ `common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>>`.
64
+
65
  *Returns:* `CD(lhs).count() / CD(rhs).count()`.
66
 
67
  ``` cpp
68
  template<class Rep1, class Period, class Rep2>
69
  constexpr duration<common_type_t<Rep1, Rep2>, Period>
70
  operator%(const duration<Rep1, Period>& d, const Rep2& s);
71
  ```
72
 
73
+ *Constraints:*
74
+ `is_convertible_v<const Rep2&, common_type_t<Rep1, Rep2>>` is `true` and
75
+ `Rep2` is not a specialization of `duration`.
76
 
77
  *Returns:* `CD(CD(d).count() % s)`.
78
 
79
  ``` cpp
80
  template<class Rep1, class Period1, class Rep2, class Period2>