PageRenderTime 36ms CodeModel.GetById 7ms app.highlight 24ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/mpl/aux_/preprocessed/no_ctps/basic_bind.hpp

http://hadesmem.googlecode.com/
C++ Header | 486 lines | 392 code | 85 blank | 9 comment | 1 complexity | e7377db9fd25b13d5c7e1617171b6901 MD5 | raw file
  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 {
 16template< bool >
 17struct resolve_arg_impl
 18{
 19    template<
 20          typename T, typename U1, typename U2, typename U3
 21        , typename U4, typename U5
 22        >
 23    struct result_
 24    {
 25        typedef T type;
 26    };
 27};
 28
 29template<>
 30struct resolve_arg_impl<true>
 31{
 32    template<
 33          typename T, typename U1, typename U2, typename U3
 34        , typename U4, typename U5
 35        >
 36    struct result_
 37    {
 38        typedef typename apply_wrap5<
 39              T
 40            , U1, U2, U3, U4, U5
 41            >::type type;
 42    };
 43};
 44
 45template< typename T > struct is_bind_template;
 46
 47template<
 48      typename T, typename U1, typename U2, typename U3, typename U4
 49    , typename U5
 50    >
 51struct resolve_bind_arg
 52    : resolve_arg_impl< is_bind_template<T>::value >
 53            ::template result_< T,U1,U2,U3,U4,U5 >
 54{
 55};
 56
 57template< int arity_ > struct bind_chooser;
 58
 59aux::no_tag is_bind_helper(...);
 60template< typename T > aux::no_tag is_bind_helper(protect<T>*);
 61
 62template<
 63      typename F, typename T1, typename T2, typename T3, typename T4
 64    , typename T5
 65    >
 66aux::yes_tag is_bind_helper(bind< F,T1,T2,T3,T4,T5 >*);
 67
 68template< int N >
 69aux::yes_tag is_bind_helper(arg<N>*);
 70
 71template< bool is_ref_  = true >
 72struct is_bind_template_impl
 73{
 74    template< typename T > struct result_
 75    {
 76        BOOST_STATIC_CONSTANT(bool, value  = false);
 77    };
 78};
 79
 80template<>
 81struct is_bind_template_impl<false>
 82{
 83    template< typename T > struct result_
 84    {
 85        BOOST_STATIC_CONSTANT(bool, value =
 86              sizeof(aux::is_bind_helper(static_cast<T*>(0)))
 87                == sizeof(aux::yes_tag)
 88            );
 89    };
 90};
 91
 92template< typename T > struct is_bind_template
 93    : is_bind_template_impl< ::boost::detail::is_reference_impl<T>::value >
 94        ::template result_<T>
 95{
 96};
 97
 98} // namespace aux
 99
100template<
101      typename F
102    >
103struct bind0
104{
105    template<
106          typename U1 = na, typename U2 = na, typename U3 = na
107        , typename U4 = na, typename U5 = na
108        >
109    struct apply
110    {
111     private:
112        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
113
114     public:
115        typedef typename apply_wrap0<
116              f_
117            >::type type;
118
119    };
120};
121
122namespace aux {
123
124template<
125      typename F
126    >
127aux::yes_tag
128is_bind_helper(bind0<F>*);
129
130} // namespace aux
131
132BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
133BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
134
135namespace aux {
136
137template<>
138struct bind_chooser<0>
139{
140    template<
141          typename F, typename T1, typename T2, typename T3, typename T4
142        , typename T5
143        >
144    struct result_
145    {
146        typedef bind0<F> type;
147    };
148};
149
150} // namespace aux
151
152template<
153      typename F, typename T1
154    >
155struct bind1
156{
157    template<
158          typename U1 = na, typename U2 = na, typename U3 = na
159        , typename U4 = na, typename U5 = na
160        >
161    struct apply
162    {
163     private:
164        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
165        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
166
167     public:
168        typedef typename apply_wrap1<
169              f_
170            , typename t1::type
171            >::type type;
172
173    };
174};
175
176namespace aux {
177
178template<
179      typename F, typename T1
180    >
181aux::yes_tag
182is_bind_helper(bind1< F,T1 >*);
183
184} // namespace aux
185
186BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
187BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
188
189namespace aux {
190
191template<>
192struct bind_chooser<1>
193{
194    template<
195          typename F, typename T1, typename T2, typename T3, typename T4
196        , typename T5
197        >
198    struct result_
199    {
200        typedef bind1< F,T1 > type;
201    };
202};
203
204} // namespace aux
205
206template<
207      typename F, typename T1, typename T2
208    >
209struct bind2
210{
211    template<
212          typename U1 = na, typename U2 = na, typename U3 = na
213        , typename U4 = na, typename U5 = na
214        >
215    struct apply
216    {
217     private:
218        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
219        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
220        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
221
222     public:
223        typedef typename apply_wrap2<
224              f_
225            , typename t1::type, typename t2::type
226            >::type type;
227
228    };
229};
230
231namespace aux {
232
233template<
234      typename F, typename T1, typename T2
235    >
236aux::yes_tag
237is_bind_helper(bind2< F,T1,T2 >*);
238
239} // namespace aux
240
241BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
242BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
243
244namespace aux {
245
246template<>
247struct bind_chooser<2>
248{
249    template<
250          typename F, typename T1, typename T2, typename T3, typename T4
251        , typename T5
252        >
253    struct result_
254    {
255        typedef bind2< F,T1,T2 > type;
256    };
257};
258
259} // namespace aux
260
261template<
262      typename F, typename T1, typename T2, typename T3
263    >
264struct bind3
265{
266    template<
267          typename U1 = na, typename U2 = na, typename U3 = na
268        , typename U4 = na, typename U5 = na
269        >
270    struct apply
271    {
272     private:
273        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
274        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
275        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
276        typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
277
278     public:
279        typedef typename apply_wrap3<
280              f_
281            , typename t1::type, typename t2::type, typename t3::type
282            >::type type;
283
284    };
285};
286
287namespace aux {
288
289template<
290      typename F, typename T1, typename T2, typename T3
291    >
292aux::yes_tag
293is_bind_helper(bind3< F,T1,T2,T3 >*);
294
295} // namespace aux
296
297BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
298BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
299
300namespace aux {
301
302template<>
303struct bind_chooser<3>
304{
305    template<
306          typename F, typename T1, typename T2, typename T3, typename T4
307        , typename T5
308        >
309    struct result_
310    {
311        typedef bind3< F,T1,T2,T3 > type;
312    };
313};
314
315} // namespace aux
316
317template<
318      typename F, typename T1, typename T2, typename T3, typename T4
319    >
320struct bind4
321{
322    template<
323          typename U1 = na, typename U2 = na, typename U3 = na
324        , typename U4 = na, typename U5 = na
325        >
326    struct apply
327    {
328     private:
329        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
330        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
331        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
332        typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
333        typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
334
335     public:
336        typedef typename apply_wrap4<
337              f_
338            , typename t1::type, typename t2::type, typename t3::type
339            , typename t4::type
340            >::type type;
341
342    };
343};
344
345namespace aux {
346
347template<
348      typename F, typename T1, typename T2, typename T3, typename T4
349    >
350aux::yes_tag
351is_bind_helper(bind4< F,T1,T2,T3,T4 >*);
352
353} // namespace aux
354
355BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
356BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
357
358namespace aux {
359
360template<>
361struct bind_chooser<4>
362{
363    template<
364          typename F, typename T1, typename T2, typename T3, typename T4
365        , typename T5
366        >
367    struct result_
368    {
369        typedef bind4< F,T1,T2,T3,T4 > type;
370    };
371};
372
373} // namespace aux
374
375template<
376      typename F, typename T1, typename T2, typename T3, typename T4
377    , typename T5
378    >
379struct bind5
380{
381    template<
382          typename U1 = na, typename U2 = na, typename U3 = na
383        , typename U4 = na, typename U5 = na
384        >
385    struct apply
386    {
387     private:
388        typedef typename aux::resolve_bind_arg< F,U1,U2,U3,U4,U5 >::type f_;
389        typedef aux::resolve_bind_arg< T1,U1,U2,U3,U4,U5 > t1;
390        typedef aux::resolve_bind_arg< T2,U1,U2,U3,U4,U5 > t2;
391        typedef aux::resolve_bind_arg< T3,U1,U2,U3,U4,U5 > t3;
392        typedef aux::resolve_bind_arg< T4,U1,U2,U3,U4,U5 > t4;
393        typedef aux::resolve_bind_arg< T5,U1,U2,U3,U4,U5 > t5;
394
395     public:
396        typedef typename apply_wrap5<
397              f_
398            , typename t1::type, typename t2::type, typename t3::type
399            , typename t4::type, typename t5::type
400            >::type type;
401
402    };
403};
404
405namespace aux {
406
407template<
408      typename F, typename T1, typename T2, typename T3, typename T4
409    , typename T5
410    >
411aux::yes_tag
412is_bind_helper(bind5< F,T1,T2,T3,T4,T5 >*);
413
414} // namespace aux
415
416BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
417BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
418
419namespace aux {
420
421template<>
422struct bind_chooser<5>
423{
424    template<
425          typename F, typename T1, typename T2, typename T3, typename T4
426        , typename T5
427        >
428    struct result_
429    {
430        typedef bind5< F,T1,T2,T3,T4,T5 > type;
431    };
432};
433
434} // namespace aux
435
436namespace aux {
437
438template< typename T >
439struct is_bind_arg
440{
441    BOOST_STATIC_CONSTANT(bool, value  = true);
442};
443
444template<>
445struct is_bind_arg<na>
446{
447    BOOST_STATIC_CONSTANT(bool, value  = false);
448};
449
450template<
451      typename T1, typename T2, typename T3, typename T4, typename T5
452    >
453struct bind_count_args
454{
455    BOOST_STATIC_CONSTANT(int, value =
456          is_bind_arg<T1>::value + is_bind_arg<T2>::value 
457        + is_bind_arg<T3>::value + is_bind_arg<T4>::value 
458        + is_bind_arg<T5>::value
459        );
460
461};
462
463}
464
465template<
466      typename F, typename T1, typename T2, typename T3, typename T4
467    , typename T5
468    >
469struct bind
470    : aux::bind_chooser<
471          aux::bind_count_args< T1,T2,T3,T4,T5 >::value
472        >::template result_< F,T1,T2,T3,T4,T5 >::type
473{
474};
475
476BOOST_MPL_AUX_ARITY_SPEC(
477      6
478    , bind
479    )
480
481BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(
482      6
483    , bind
484    )
485}}
486