Chris@16
|
1 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
2 // funop.hpp
|
Chris@16
|
3 // Contains definition of funop[n]\<\> class template.
|
Chris@16
|
4 //
|
Chris@16
|
5 // Copyright 2008 Eric Niebler. Distributed under the Boost
|
Chris@16
|
6 // Software License, Version 1.0. (See accompanying file
|
Chris@16
|
7 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8
|
Chris@16
|
9
|
Chris@16
|
10 template<typename Expr, typename Domain >
|
Chris@16
|
11 struct funop0
|
Chris@16
|
12 {
|
Chris@16
|
13 typedef typename proto::base_expr<
|
Chris@16
|
14 Domain
|
Chris@16
|
15 , tag::function
|
Chris@16
|
16 , list1<
|
Chris@16
|
17 Expr &
|
Chris@16
|
18
|
Chris@16
|
19 >
|
Chris@16
|
20 >::type type;
|
Chris@16
|
21 BOOST_FORCEINLINE
|
Chris@16
|
22 static type const call(
|
Chris@16
|
23 Expr &e
|
Chris@16
|
24
|
Chris@16
|
25 )
|
Chris@16
|
26 {
|
Chris@16
|
27 type that = {
|
Chris@16
|
28 e
|
Chris@16
|
29
|
Chris@16
|
30 };
|
Chris@16
|
31 return that;
|
Chris@16
|
32 }
|
Chris@16
|
33 };
|
Chris@16
|
34
|
Chris@16
|
35
|
Chris@16
|
36 template<typename Expr , typename This, typename Domain>
|
Chris@16
|
37 struct funop<Expr(), This, Domain>
|
Chris@16
|
38 : funop0<
|
Chris@16
|
39 typename detail::same_cv<Expr, This>::type
|
Chris@16
|
40 , Domain
|
Chris@16
|
41
|
Chris@16
|
42 >
|
Chris@16
|
43 {};
|
Chris@16
|
44
|
Chris@16
|
45
|
Chris@16
|
46 template<typename Expr, typename Domain , typename A0>
|
Chris@16
|
47 struct funop1
|
Chris@16
|
48 {
|
Chris@16
|
49 typedef typename proto::base_expr<
|
Chris@16
|
50 Domain
|
Chris@16
|
51 , tag::function
|
Chris@16
|
52 , list2<
|
Chris@16
|
53 Expr &
|
Chris@16
|
54 , typename proto::result_of::as_child<A0, Domain>::type
|
Chris@16
|
55 >
|
Chris@16
|
56 >::type type;
|
Chris@16
|
57 BOOST_FORCEINLINE
|
Chris@16
|
58 static type const call(
|
Chris@16
|
59 Expr &e
|
Chris@16
|
60 , A0 &a0
|
Chris@16
|
61 )
|
Chris@16
|
62 {
|
Chris@16
|
63 type that = {
|
Chris@16
|
64 e
|
Chris@16
|
65 , proto::as_child<Domain>(a0)
|
Chris@16
|
66 };
|
Chris@16
|
67 return that;
|
Chris@16
|
68 }
|
Chris@16
|
69 };
|
Chris@16
|
70
|
Chris@16
|
71
|
Chris@16
|
72 template<typename Expr , typename A0, typename This, typename Domain>
|
Chris@16
|
73 struct funop<Expr(A0), This, Domain>
|
Chris@16
|
74 : funop1<
|
Chris@16
|
75 typename detail::same_cv<Expr, This>::type
|
Chris@16
|
76 , Domain
|
Chris@16
|
77 , typename remove_reference<A0 >::type
|
Chris@16
|
78 >
|
Chris@16
|
79 {};
|
Chris@16
|
80
|
Chris@16
|
81
|
Chris@16
|
82 template<typename Expr, typename Domain , typename A0 , typename A1>
|
Chris@16
|
83 struct funop2
|
Chris@16
|
84 {
|
Chris@16
|
85 typedef typename proto::base_expr<
|
Chris@16
|
86 Domain
|
Chris@16
|
87 , tag::function
|
Chris@16
|
88 , list3<
|
Chris@16
|
89 Expr &
|
Chris@16
|
90 , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type
|
Chris@16
|
91 >
|
Chris@16
|
92 >::type type;
|
Chris@16
|
93 BOOST_FORCEINLINE
|
Chris@16
|
94 static type const call(
|
Chris@16
|
95 Expr &e
|
Chris@16
|
96 , A0 &a0 , A1 &a1
|
Chris@16
|
97 )
|
Chris@16
|
98 {
|
Chris@16
|
99 type that = {
|
Chris@16
|
100 e
|
Chris@16
|
101 , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1)
|
Chris@16
|
102 };
|
Chris@16
|
103 return that;
|
Chris@16
|
104 }
|
Chris@16
|
105 };
|
Chris@16
|
106
|
Chris@16
|
107
|
Chris@16
|
108 template<typename Expr , typename A0 , typename A1, typename This, typename Domain>
|
Chris@16
|
109 struct funop<Expr(A0 , A1), This, Domain>
|
Chris@16
|
110 : funop2<
|
Chris@16
|
111 typename detail::same_cv<Expr, This>::type
|
Chris@16
|
112 , Domain
|
Chris@16
|
113 , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type
|
Chris@16
|
114 >
|
Chris@16
|
115 {};
|
Chris@16
|
116
|
Chris@16
|
117
|
Chris@16
|
118 template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2>
|
Chris@16
|
119 struct funop3
|
Chris@16
|
120 {
|
Chris@16
|
121 typedef typename proto::base_expr<
|
Chris@16
|
122 Domain
|
Chris@16
|
123 , tag::function
|
Chris@16
|
124 , list4<
|
Chris@16
|
125 Expr &
|
Chris@16
|
126 , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type
|
Chris@16
|
127 >
|
Chris@16
|
128 >::type type;
|
Chris@16
|
129 BOOST_FORCEINLINE
|
Chris@16
|
130 static type const call(
|
Chris@16
|
131 Expr &e
|
Chris@16
|
132 , A0 &a0 , A1 &a1 , A2 &a2
|
Chris@16
|
133 )
|
Chris@16
|
134 {
|
Chris@16
|
135 type that = {
|
Chris@16
|
136 e
|
Chris@16
|
137 , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2)
|
Chris@16
|
138 };
|
Chris@16
|
139 return that;
|
Chris@16
|
140 }
|
Chris@16
|
141 };
|
Chris@16
|
142
|
Chris@16
|
143
|
Chris@16
|
144 template<typename Expr , typename A0 , typename A1 , typename A2, typename This, typename Domain>
|
Chris@16
|
145 struct funop<Expr(A0 , A1 , A2), This, Domain>
|
Chris@16
|
146 : funop3<
|
Chris@16
|
147 typename detail::same_cv<Expr, This>::type
|
Chris@16
|
148 , Domain
|
Chris@16
|
149 , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type
|
Chris@16
|
150 >
|
Chris@16
|
151 {};
|
Chris@16
|
152
|
Chris@16
|
153
|
Chris@16
|
154 template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3>
|
Chris@16
|
155 struct funop4
|
Chris@16
|
156 {
|
Chris@16
|
157 typedef typename proto::base_expr<
|
Chris@16
|
158 Domain
|
Chris@16
|
159 , tag::function
|
Chris@16
|
160 , list5<
|
Chris@16
|
161 Expr &
|
Chris@16
|
162 , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type
|
Chris@16
|
163 >
|
Chris@16
|
164 >::type type;
|
Chris@16
|
165 BOOST_FORCEINLINE
|
Chris@16
|
166 static type const call(
|
Chris@16
|
167 Expr &e
|
Chris@16
|
168 , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3
|
Chris@16
|
169 )
|
Chris@16
|
170 {
|
Chris@16
|
171 type that = {
|
Chris@16
|
172 e
|
Chris@16
|
173 , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3)
|
Chris@16
|
174 };
|
Chris@16
|
175 return that;
|
Chris@16
|
176 }
|
Chris@16
|
177 };
|
Chris@16
|
178
|
Chris@16
|
179
|
Chris@16
|
180 template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3, typename This, typename Domain>
|
Chris@16
|
181 struct funop<Expr(A0 , A1 , A2 , A3), This, Domain>
|
Chris@16
|
182 : funop4<
|
Chris@16
|
183 typename detail::same_cv<Expr, This>::type
|
Chris@16
|
184 , Domain
|
Chris@16
|
185 , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type
|
Chris@16
|
186 >
|
Chris@16
|
187 {};
|
Chris@16
|
188
|
Chris@16
|
189
|
Chris@16
|
190 template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
|
Chris@16
|
191 struct funop5
|
Chris@16
|
192 {
|
Chris@16
|
193 typedef typename proto::base_expr<
|
Chris@16
|
194 Domain
|
Chris@16
|
195 , tag::function
|
Chris@16
|
196 , list6<
|
Chris@16
|
197 Expr &
|
Chris@16
|
198 , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type , typename proto::result_of::as_child<A4, Domain>::type
|
Chris@16
|
199 >
|
Chris@16
|
200 >::type type;
|
Chris@16
|
201 BOOST_FORCEINLINE
|
Chris@16
|
202 static type const call(
|
Chris@16
|
203 Expr &e
|
Chris@16
|
204 , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4
|
Chris@16
|
205 )
|
Chris@16
|
206 {
|
Chris@16
|
207 type that = {
|
Chris@16
|
208 e
|
Chris@16
|
209 , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3) , proto::as_child<Domain>(a4)
|
Chris@16
|
210 };
|
Chris@16
|
211 return that;
|
Chris@16
|
212 }
|
Chris@16
|
213 };
|
Chris@16
|
214
|
Chris@16
|
215
|
Chris@16
|
216 template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3 , typename A4, typename This, typename Domain>
|
Chris@16
|
217 struct funop<Expr(A0 , A1 , A2 , A3 , A4), This, Domain>
|
Chris@16
|
218 : funop5<
|
Chris@16
|
219 typename detail::same_cv<Expr, This>::type
|
Chris@16
|
220 , Domain
|
Chris@16
|
221 , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type , typename remove_reference<A4 >::type
|
Chris@16
|
222 >
|
Chris@16
|
223 {};
|
Chris@16
|
224
|
Chris@16
|
225
|
Chris@16
|
226 template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
|
Chris@16
|
227 struct funop6
|
Chris@16
|
228 {
|
Chris@16
|
229 typedef typename proto::base_expr<
|
Chris@16
|
230 Domain
|
Chris@16
|
231 , tag::function
|
Chris@16
|
232 , list7<
|
Chris@16
|
233 Expr &
|
Chris@16
|
234 , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type , typename proto::result_of::as_child<A4, Domain>::type , typename proto::result_of::as_child<A5, Domain>::type
|
Chris@16
|
235 >
|
Chris@16
|
236 >::type type;
|
Chris@16
|
237 BOOST_FORCEINLINE
|
Chris@16
|
238 static type const call(
|
Chris@16
|
239 Expr &e
|
Chris@16
|
240 , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5
|
Chris@16
|
241 )
|
Chris@16
|
242 {
|
Chris@16
|
243 type that = {
|
Chris@16
|
244 e
|
Chris@16
|
245 , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3) , proto::as_child<Domain>(a4) , proto::as_child<Domain>(a5)
|
Chris@16
|
246 };
|
Chris@16
|
247 return that;
|
Chris@16
|
248 }
|
Chris@16
|
249 };
|
Chris@16
|
250
|
Chris@16
|
251
|
Chris@16
|
252 template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5, typename This, typename Domain>
|
Chris@16
|
253 struct funop<Expr(A0 , A1 , A2 , A3 , A4 , A5), This, Domain>
|
Chris@16
|
254 : funop6<
|
Chris@16
|
255 typename detail::same_cv<Expr, This>::type
|
Chris@16
|
256 , Domain
|
Chris@16
|
257 , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type , typename remove_reference<A4 >::type , typename remove_reference<A5 >::type
|
Chris@16
|
258 >
|
Chris@16
|
259 {};
|
Chris@16
|
260
|
Chris@16
|
261
|
Chris@16
|
262 template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
|
Chris@16
|
263 struct funop7
|
Chris@16
|
264 {
|
Chris@16
|
265 typedef typename proto::base_expr<
|
Chris@16
|
266 Domain
|
Chris@16
|
267 , tag::function
|
Chris@16
|
268 , list8<
|
Chris@16
|
269 Expr &
|
Chris@16
|
270 , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type , typename proto::result_of::as_child<A4, Domain>::type , typename proto::result_of::as_child<A5, Domain>::type , typename proto::result_of::as_child<A6, Domain>::type
|
Chris@16
|
271 >
|
Chris@16
|
272 >::type type;
|
Chris@16
|
273 BOOST_FORCEINLINE
|
Chris@16
|
274 static type const call(
|
Chris@16
|
275 Expr &e
|
Chris@16
|
276 , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6
|
Chris@16
|
277 )
|
Chris@16
|
278 {
|
Chris@16
|
279 type that = {
|
Chris@16
|
280 e
|
Chris@16
|
281 , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3) , proto::as_child<Domain>(a4) , proto::as_child<Domain>(a5) , proto::as_child<Domain>(a6)
|
Chris@16
|
282 };
|
Chris@16
|
283 return that;
|
Chris@16
|
284 }
|
Chris@16
|
285 };
|
Chris@16
|
286
|
Chris@16
|
287
|
Chris@16
|
288 template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6, typename This, typename Domain>
|
Chris@16
|
289 struct funop<Expr(A0 , A1 , A2 , A3 , A4 , A5 , A6), This, Domain>
|
Chris@16
|
290 : funop7<
|
Chris@16
|
291 typename detail::same_cv<Expr, This>::type
|
Chris@16
|
292 , Domain
|
Chris@16
|
293 , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type , typename remove_reference<A4 >::type , typename remove_reference<A5 >::type , typename remove_reference<A6 >::type
|
Chris@16
|
294 >
|
Chris@16
|
295 {};
|
Chris@16
|
296
|
Chris@16
|
297
|
Chris@16
|
298 template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
|
Chris@16
|
299 struct funop8
|
Chris@16
|
300 {
|
Chris@16
|
301 typedef typename proto::base_expr<
|
Chris@16
|
302 Domain
|
Chris@16
|
303 , tag::function
|
Chris@16
|
304 , list9<
|
Chris@16
|
305 Expr &
|
Chris@16
|
306 , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type , typename proto::result_of::as_child<A4, Domain>::type , typename proto::result_of::as_child<A5, Domain>::type , typename proto::result_of::as_child<A6, Domain>::type , typename proto::result_of::as_child<A7, Domain>::type
|
Chris@16
|
307 >
|
Chris@16
|
308 >::type type;
|
Chris@16
|
309 BOOST_FORCEINLINE
|
Chris@16
|
310 static type const call(
|
Chris@16
|
311 Expr &e
|
Chris@16
|
312 , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7
|
Chris@16
|
313 )
|
Chris@16
|
314 {
|
Chris@16
|
315 type that = {
|
Chris@16
|
316 e
|
Chris@16
|
317 , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3) , proto::as_child<Domain>(a4) , proto::as_child<Domain>(a5) , proto::as_child<Domain>(a6) , proto::as_child<Domain>(a7)
|
Chris@16
|
318 };
|
Chris@16
|
319 return that;
|
Chris@16
|
320 }
|
Chris@16
|
321 };
|
Chris@16
|
322
|
Chris@16
|
323
|
Chris@16
|
324 template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7, typename This, typename Domain>
|
Chris@16
|
325 struct funop<Expr(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7), This, Domain>
|
Chris@16
|
326 : funop8<
|
Chris@16
|
327 typename detail::same_cv<Expr, This>::type
|
Chris@16
|
328 , Domain
|
Chris@16
|
329 , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type , typename remove_reference<A4 >::type , typename remove_reference<A5 >::type , typename remove_reference<A6 >::type , typename remove_reference<A7 >::type
|
Chris@16
|
330 >
|
Chris@16
|
331 {};
|
Chris@16
|
332
|
Chris@16
|
333
|
Chris@16
|
334 template<typename Expr, typename Domain , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
|
Chris@16
|
335 struct funop9
|
Chris@16
|
336 {
|
Chris@16
|
337 typedef typename proto::base_expr<
|
Chris@16
|
338 Domain
|
Chris@16
|
339 , tag::function
|
Chris@16
|
340 , list10<
|
Chris@16
|
341 Expr &
|
Chris@16
|
342 , typename proto::result_of::as_child<A0, Domain>::type , typename proto::result_of::as_child<A1, Domain>::type , typename proto::result_of::as_child<A2, Domain>::type , typename proto::result_of::as_child<A3, Domain>::type , typename proto::result_of::as_child<A4, Domain>::type , typename proto::result_of::as_child<A5, Domain>::type , typename proto::result_of::as_child<A6, Domain>::type , typename proto::result_of::as_child<A7, Domain>::type , typename proto::result_of::as_child<A8, Domain>::type
|
Chris@16
|
343 >
|
Chris@16
|
344 >::type type;
|
Chris@16
|
345 BOOST_FORCEINLINE
|
Chris@16
|
346 static type const call(
|
Chris@16
|
347 Expr &e
|
Chris@16
|
348 , A0 &a0 , A1 &a1 , A2 &a2 , A3 &a3 , A4 &a4 , A5 &a5 , A6 &a6 , A7 &a7 , A8 &a8
|
Chris@16
|
349 )
|
Chris@16
|
350 {
|
Chris@16
|
351 type that = {
|
Chris@16
|
352 e
|
Chris@16
|
353 , proto::as_child<Domain>(a0) , proto::as_child<Domain>(a1) , proto::as_child<Domain>(a2) , proto::as_child<Domain>(a3) , proto::as_child<Domain>(a4) , proto::as_child<Domain>(a5) , proto::as_child<Domain>(a6) , proto::as_child<Domain>(a7) , proto::as_child<Domain>(a8)
|
Chris@16
|
354 };
|
Chris@16
|
355 return that;
|
Chris@16
|
356 }
|
Chris@16
|
357 };
|
Chris@16
|
358
|
Chris@16
|
359
|
Chris@16
|
360 template<typename Expr , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8, typename This, typename Domain>
|
Chris@16
|
361 struct funop<Expr(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8), This, Domain>
|
Chris@16
|
362 : funop9<
|
Chris@16
|
363 typename detail::same_cv<Expr, This>::type
|
Chris@16
|
364 , Domain
|
Chris@16
|
365 , typename remove_reference<A0 >::type , typename remove_reference<A1 >::type , typename remove_reference<A2 >::type , typename remove_reference<A3 >::type , typename remove_reference<A4 >::type , typename remove_reference<A5 >::type , typename remove_reference<A6 >::type , typename remove_reference<A7 >::type , typename remove_reference<A8 >::type
|
Chris@16
|
366 >
|
Chris@16
|
367 {};
|