From Jason Turner

[arithmetic.operations]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpqql8zuoy/{from.md → to.md} +115 -66
tmp/tmpqql8zuoy/{from.md → to.md} RENAMED
@@ -1,136 +1,185 @@
1
  ### Arithmetic operations <a id="arithmetic.operations">[[arithmetic.operations]]</a>
2
 
3
  The library provides basic function object classes for all of the
4
  arithmetic operators in the language ([[expr.mul]], [[expr.add]]).
5
 
 
 
6
  ``` cpp
7
  template <class T = void> struct plus {
8
  constexpr T operator()(const T& x, const T& y) const;
9
- typedef T first_argument_type;
10
- typedef T second_argument_type;
11
- typedef T result_type;
12
  };
13
  ```
14
 
15
- `operator()` returns `x + y`.
16
-
17
- ``` cpp
18
- template <class T = void> struct minus {
19
- constexpr T operator()(const T& x, const T& y) const;
20
- typedef T first_argument_type;
21
- typedef T second_argument_type;
22
- typedef T result_type;
23
- };
24
- ```
25
-
26
- `operator()` returns `x - y`.
27
-
28
- ``` cpp
29
- template <class T = void> struct multiplies {
30
- constexpr T operator()(const T& x, const T& y) const;
31
- typedef T first_argument_type;
32
- typedef T second_argument_type;
33
- typedef T result_type;
34
- };
35
- ```
36
-
37
- `operator()` returns `x * y`.
38
-
39
  ``` cpp
40
- template <class T = void> struct divides {
41
  constexpr T operator()(const T& x, const T& y) const;
42
- typedef T first_argument_type;
43
- typedef T second_argument_type;
44
- typedef T result_type;
45
- };
46
- ```
47
-
48
- `operator()` returns `x / y`.
49
-
50
- ``` cpp
51
- template <class T = void> struct modulus {
52
- constexpr T operator()(const T& x, const T& y) const;
53
- typedef T first_argument_type;
54
- typedef T second_argument_type;
55
- typedef T result_type;
56
- };
57
- ```
58
-
59
- `operator()` returns `x % y`.
60
-
61
- ``` cpp
62
- template <class T = void> struct negate {
63
- constexpr T operator()(const T& x) const;
64
- typedef T argument_type;
65
- typedef T result_type;
66
- };
67
  ```
68
 
69
- `operator()` returns `-x`.
70
 
71
  ``` cpp
72
  template <> struct plus<void> {
73
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
74
  -> decltype(std::forward<T>(t) + std::forward<U>(u));
75
 
76
- typedef unspecified is_transparent;
77
  };
78
  ```
79
 
80
- `operator()` returns `std::forward<T>(t) + std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
  ``` cpp
83
  template <> struct minus<void> {
84
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
85
  -> decltype(std::forward<T>(t) - std::forward<U>(u));
86
 
87
- typedef unspecified is_transparent;
88
  };
89
  ```
90
 
91
- `operator()` returns `std::forward<T>(t) - std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
 
93
  ``` cpp
94
  template <> struct multiplies<void> {
95
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
96
  -> decltype(std::forward<T>(t) * std::forward<U>(u));
97
 
98
- typedef unspecified is_transparent;
99
  };
100
  ```
101
 
102
- `operator()` returns `std::forward<T>(t) * std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
 
104
  ``` cpp
105
  template <> struct divides<void> {
106
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
107
  -> decltype(std::forward<T>(t) / std::forward<U>(u));
108
 
109
- typedef unspecified is_transparent;
110
  };
111
  ```
112
 
113
- `operator()` returns `std::forward<T>(t) / std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
 
115
  ``` cpp
116
  template <> struct modulus<void> {
117
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
118
  -> decltype(std::forward<T>(t) % std::forward<U>(u));
119
 
120
- typedef unspecified is_transparent;
121
  };
122
  ```
123
 
124
- `operator()` returns `std::forward<T>(t) % std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
  ``` cpp
127
  template <> struct negate<void> {
128
  template <class T> constexpr auto operator()(T&& t) const
129
  -> decltype(-std::forward<T>(t));
130
 
131
- typedef unspecified is_transparent;
132
  };
133
  ```
134
 
135
- `operator()` returns `-std::forward<T>(t)`.
 
 
 
 
 
136
 
 
1
  ### Arithmetic operations <a id="arithmetic.operations">[[arithmetic.operations]]</a>
2
 
3
  The library provides basic function object classes for all of the
4
  arithmetic operators in the language ([[expr.mul]], [[expr.add]]).
5
 
6
+ #### Class template `plus` <a id="arithmetic.operations.plus">[[arithmetic.operations.plus]]</a>
7
+
8
  ``` cpp
9
  template <class T = void> struct plus {
10
  constexpr T operator()(const T& x, const T& y) const;
 
 
 
11
  };
12
  ```
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ``` cpp
 
15
  constexpr T operator()(const T& x, const T& y) const;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  ```
17
 
18
+ *Returns:* `x + y`.
19
 
20
  ``` cpp
21
  template <> struct plus<void> {
22
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
23
  -> decltype(std::forward<T>(t) + std::forward<U>(u));
24
 
25
+ using is_transparent = unspecified;
26
  };
27
  ```
28
 
29
+ ``` cpp
30
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
31
+ -> decltype(std::forward<T>(t) + std::forward<U>(u));
32
+ ```
33
+
34
+ *Returns:* `std::forward<T>(t) + std::forward<U>(u)`.
35
+
36
+ #### Class template `minus` <a id="arithmetic.operations.minus">[[arithmetic.operations.minus]]</a>
37
+
38
+ ``` cpp
39
+ template <class T = void> struct minus {
40
+ constexpr T operator()(const T& x, const T& y) const;
41
+ };
42
+ ```
43
+
44
+ ``` cpp
45
+ constexpr T operator()(const T& x, const T& y) const;
46
+ ```
47
+
48
+ *Returns:* `x - y`.
49
 
50
  ``` cpp
51
  template <> struct minus<void> {
52
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
53
  -> decltype(std::forward<T>(t) - std::forward<U>(u));
54
 
55
+ using is_transparent = unspecified;
56
  };
57
  ```
58
 
59
+ ``` cpp
60
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
61
+ -> decltype(std::forward<T>(t) - std::forward<U>(u));
62
+ ```
63
+
64
+ *Returns:* `std::forward<T>(t) - std::forward<U>(u)`.
65
+
66
+ #### Class template `multiplies` <a id="arithmetic.operations.multiplies">[[arithmetic.operations.multiplies]]</a>
67
+
68
+ ``` cpp
69
+ template <class T = void> struct multiplies {
70
+ constexpr T operator()(const T& x, const T& y) const;
71
+ };
72
+ ```
73
+
74
+ ``` cpp
75
+ constexpr T operator()(const T& x, const T& y) const;
76
+ ```
77
+
78
+ *Returns:* `x * y`.
79
 
80
  ``` cpp
81
  template <> struct multiplies<void> {
82
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
83
  -> decltype(std::forward<T>(t) * std::forward<U>(u));
84
 
85
+ using is_transparent = unspecified;
86
  };
87
  ```
88
 
89
+ ``` cpp
90
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
91
+ -> decltype(std::forward<T>(t) * std::forward<U>(u));
92
+ ```
93
+
94
+ *Returns:* `std::forward<T>(t) * std::forward<U>(u)`.
95
+
96
+ #### Class template `divides` <a id="arithmetic.operations.divides">[[arithmetic.operations.divides]]</a>
97
+
98
+ ``` cpp
99
+ template <class T = void> struct divides {
100
+ constexpr T operator()(const T& x, const T& y) const;
101
+ };
102
+ ```
103
+
104
+ ``` cpp
105
+ constexpr T operator()(const T& x, const T& y) const;
106
+ ```
107
+
108
+ *Returns:* `x / y`.
109
 
110
  ``` cpp
111
  template <> struct divides<void> {
112
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
113
  -> decltype(std::forward<T>(t) / std::forward<U>(u));
114
 
115
+ using is_transparent = unspecified;
116
  };
117
  ```
118
 
119
+ ``` cpp
120
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
121
+ -> decltype(std::forward<T>(t) / std::forward<U>(u));
122
+ ```
123
+
124
+ *Returns:* `std::forward<T>(t) / std::forward<U>(u)`.
125
+
126
+ #### Class template `modulus` <a id="arithmetic.operations.modulus">[[arithmetic.operations.modulus]]</a>
127
+
128
+ ``` cpp
129
+ template <class T = void> struct modulus {
130
+ constexpr T operator()(const T& x, const T& y) const;
131
+ };
132
+ ```
133
+
134
+ ``` cpp
135
+ constexpr T operator()(const T& x, const T& y) const;
136
+ ```
137
+
138
+ *Returns:* `x % y`.
139
 
140
  ``` cpp
141
  template <> struct modulus<void> {
142
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
143
  -> decltype(std::forward<T>(t) % std::forward<U>(u));
144
 
145
+ using is_transparent = unspecified;
146
  };
147
  ```
148
 
149
+ ``` cpp
150
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
151
+ -> decltype(std::forward<T>(t) % std::forward<U>(u));
152
+ ```
153
+
154
+ *Returns:* `std::forward<T>(t) % std::forward<U>(u)`.
155
+
156
+ #### Class template `negate` <a id="arithmetic.operations.negate">[[arithmetic.operations.negate]]</a>
157
+
158
+ ``` cpp
159
+ template <class T = void> struct negate {
160
+ constexpr T operator()(const T& x) const;
161
+ };
162
+ ```
163
+
164
+ ``` cpp
165
+ constexpr T operator()(const T& x) const;
166
+ ```
167
+
168
+ *Returns:* `-x`.
169
 
170
  ``` cpp
171
  template <> struct negate<void> {
172
  template <class T> constexpr auto operator()(T&& t) const
173
  -> decltype(-std::forward<T>(t));
174
 
175
+ using is_transparent = unspecified;
176
  };
177
  ```
178
 
179
+ ``` cpp
180
+ template <class T> constexpr auto operator()(T&& t) const
181
+ -> decltype(-std::forward<T>(t));
182
+ ```
183
+
184
+ *Returns:* `-std::forward<T>(t)`.
185