source: NonGTP/Boost/boost/mpl/aux_/preprocessed/dmc/basic_bind.hpp @ 857

Revision 857, 9.7 KB checked in by igarcia, 19 years ago (diff)
Line 
1
2// Copyright Peter Dimov 2001
3// Copyright Aleksey Gurtovoy 2001-2004
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9
10// Preprocessed version of "boost/mpl/aux_/basic_bind.hpp" header
11// -- DO NOT modify by hand!
12
13namespace boost { namespace mpl {
14
15namespace aux {
16
17template<
18      typename T, typename U1, typename U2, typename U3, typename U4
19    , typename U5
20    >
21struct resolve_bind_arg
22{
23    typedef T type;
24};
25
26template<
27      int N, typename U1, typename U2, typename U3, typename U4, typename U5
28    >
29struct resolve_bind_arg< arg<N>, U1, U2, U3, U4, U5 >
30{
31    typedef typename apply_wrap5<mpl::arg<N>, U1, U2, U3, U4, U5>::type type;
32};
33
34template<
35      typename F, typename T1, typename T2, typename T3, typename T4
36    , typename T5, typename U1, typename U2, typename U3, typename U4
37    , typename U5
38    >
39struct resolve_bind_arg< bind< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5 >
40{
41    typedef bind< F,T1,T2,T3,T4,T5 > f_;
42    typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
43};
44
45} // namespace aux
46
47template<
48      typename F, int dummy_
49    >
50struct bind0
51{
52    template<
53          typename U1 = na, typename U2 = na, typename U3 = na
54        , typename U4 = na, typename U5 = na
55        >
56    struct apply
57    {
58     private:
59        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
60
61     public:
62        typedef typename apply_wrap0<
63              f_
64            >::type type;
65
66    };
67};
68
69namespace aux {
70
71template<
72      typename F, typename U1, typename U2, typename U3, typename U4
73    , typename U5
74    >
75struct resolve_bind_arg<
76      bind0<F>, U1, U2, U3, U4, U5
77    >
78{
79    typedef bind0<F> f_;
80    typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
81};
82
83} // namespace aux
84
85BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
86BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
87
88template<
89      typename F, int dummy_
90    >
91struct bind< F,na,na,na,na,na >
92    : bind0<F>
93{
94};
95
96template<
97      typename F, typename T1, int dummy_
98    >
99struct bind1
100{
101    template<
102          typename U1 = na, typename U2 = na, typename U3 = na
103        , typename U4 = na, typename U5 = na
104        >
105    struct apply
106    {
107     private:
108        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
109        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
110
111     public:
112        typedef typename apply_wrap1<
113              f_
114            , typename t1::type
115            >::type type;
116
117    };
118};
119
120namespace aux {
121
122template<
123      typename F, typename T1, typename U1, typename U2, typename U3
124    , typename U4, typename U5
125    >
126struct resolve_bind_arg<
127      bind1< F,T1 >, U1, U2, U3, U4, U5
128    >
129{
130    typedef bind1< F,T1 > f_;
131    typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
132};
133
134} // namespace aux
135
136BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
137BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
138
139template<
140      typename F, typename T1, int dummy_
141    >
142struct bind< F,T1,na,na,na,na >
143    : bind1< F,T1 >
144{
145};
146
147template<
148      typename F, typename T1, typename T2, int dummy_
149    >
150struct bind2
151{
152    template<
153          typename U1 = na, typename U2 = na, typename U3 = na
154        , typename U4 = na, typename U5 = na
155        >
156    struct apply
157    {
158     private:
159        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
160        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
161        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
162
163     public:
164        typedef typename apply_wrap2<
165              f_
166            , typename t1::type, typename t2::type
167            >::type type;
168
169    };
170};
171
172namespace aux {
173
174template<
175      typename F, typename T1, typename T2, typename U1, typename U2
176    , typename U3, typename U4, typename U5
177    >
178struct resolve_bind_arg<
179      bind2< F,T1,T2 >, U1, U2, U3, U4, U5
180    >
181{
182    typedef bind2< F,T1,T2 > f_;
183    typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
184};
185
186} // namespace aux
187
188BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
189BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
190
191template<
192      typename F, typename T1, typename T2, int dummy_
193    >
194struct bind< F,T1,T2,na,na,na >
195    : bind2< F,T1,T2 >
196{
197};
198
199template<
200      typename F, typename T1, typename T2, typename T3, int dummy_
201    >
202struct bind3
203{
204    template<
205          typename U1 = na, typename U2 = na, typename U3 = na
206        , typename U4 = na, typename U5 = na
207        >
208    struct apply
209    {
210     private:
211        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
212        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
213        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
214        typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
215
216     public:
217        typedef typename apply_wrap3<
218              f_
219            , typename t1::type, typename t2::type, typename t3::type
220            >::type type;
221
222    };
223};
224
225namespace aux {
226
227template<
228      typename F, typename T1, typename T2, typename T3, typename U1
229    , typename U2, typename U3, typename U4, typename U5
230    >
231struct resolve_bind_arg<
232      bind3< F,T1,T2,T3 >, U1, U2, U3, U4, U5
233    >
234{
235    typedef bind3< F,T1,T2,T3 > f_;
236    typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
237};
238
239} // namespace aux
240
241BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
242BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
243
244template<
245      typename F, typename T1, typename T2, typename T3, int dummy_
246    >
247struct bind< F,T1,T2,T3,na,na >
248    : bind3< F,T1,T2,T3 >
249{
250};
251
252template<
253      typename F, typename T1, typename T2, typename T3, typename T4
254    , int dummy_
255    >
256struct bind4
257{
258    template<
259          typename U1 = na, typename U2 = na, typename U3 = na
260        , typename U4 = na, typename U5 = na
261        >
262    struct apply
263    {
264     private:
265        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
266        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
267        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
268        typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
269        typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
270
271     public:
272        typedef typename apply_wrap4<
273              f_
274            , typename t1::type, typename t2::type, typename t3::type
275            , typename t4::type
276            >::type type;
277
278    };
279};
280
281namespace aux {
282
283template<
284      typename F, typename T1, typename T2, typename T3, typename T4
285    , typename U1, typename U2, typename U3, typename U4, typename U5
286    >
287struct resolve_bind_arg<
288      bind4< F,T1,T2,T3,T4 >, U1, U2, U3, U4, U5
289    >
290{
291    typedef bind4< F,T1,T2,T3,T4 > f_;
292    typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
293};
294
295} // namespace aux
296
297BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
298BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
299
300template<
301      typename F, typename T1, typename T2, typename T3, typename T4
302    , int dummy_
303    >
304struct bind< F,T1,T2,T3,T4,na >
305    : bind4< F,T1,T2,T3,T4 >
306{
307};
308
309template<
310      typename F, typename T1, typename T2, typename T3, typename T4
311    , typename T5, int dummy_
312    >
313struct bind5
314{
315    template<
316          typename U1 = na, typename U2 = na, typename U3 = na
317        , typename U4 = na, typename U5 = na
318        >
319    struct apply
320    {
321     private:
322        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
323        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
324        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
325        typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
326        typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
327        typedef aux::resolve_bind_arg< T5,U1,U2,U3,U4,U5 > t5;
328
329     public:
330        typedef typename apply_wrap5<
331              f_
332            , typename t1::type, typename t2::type, typename t3::type
333            , typename t4::type, typename t5::type
334            >::type type;
335
336    };
337};
338
339namespace aux {
340
341template<
342      typename F, typename T1, typename T2, typename T3, typename T4
343    , typename T5, typename U1, typename U2, typename U3, typename U4
344    , typename U5
345    >
346struct resolve_bind_arg<
347      bind5< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5
348    >
349{
350    typedef bind5< F,T1,T2,T3,T4,T5 > f_;
351    typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
352};
353
354} // namespace aux
355
356BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
357BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
358
359/// primary template (not a specialization!)
360
361template<
362      typename F, typename T1, typename T2, typename T3, typename T4
363    , typename T5, int dummy_
364    >
365struct bind
366    : bind5< F,T1,T2,T3,T4,T5 >
367{
368};
369
370/// if_/eval_if specializations
371template< template< typename T1, typename T2, typename T3 > class F, typename Tag >
372struct quote3;
373
374template< typename T1, typename T2, typename T3 > struct if_;
375
376template<
377      typename Tag, typename T1, typename T2, typename T3
378    >
379struct bind3<
380      quote3< if_,Tag >
381    , T1, T2, T3
382    >
383{
384    template<
385          typename U1 = na, typename U2 = na, typename U3 = na
386        , typename U4 = na, typename U5 = na
387        >
388    struct apply
389    {
390     private:
391        typedef mpl::arg<1> n1;
392        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
393        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
394        typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
395        typedef typename if_<
396              typename t1::type
397            , t2, t3
398            >::type f_;
399
400     public:
401        typedef typename f_::type type;
402    };
403};
404
405}}
406
Note: See TracBrowser for help on using the repository browser.