Home | History | Annotate | Download | only in gcc
      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/bind.hpp" header
     11 // -- DO NOT modify by hand!
     12 
     13 namespace boost { namespace mpl {
     14 
     15 namespace aux {
     16 
     17 template<
     18       typename T, typename U1, typename U2, typename U3, typename U4
     19     , typename U5
     20     >
     21 struct resolve_bind_arg
     22 {
     23     typedef T type;
     24 };
     25 
     26 template<
     27       typename T
     28     , typename Arg
     29     >
     30 struct replace_unnamed_arg
     31 {
     32     typedef Arg next;
     33     typedef T type;
     34 };
     35 
     36 template<
     37       typename Arg
     38     >
     39 struct replace_unnamed_arg< arg< -1 >, Arg >
     40 {
     41     typedef typename Arg::next next;
     42     typedef Arg type;
     43 };
     44 
     45 template<
     46       int N, typename U1, typename U2, typename U3, typename U4, typename U5
     47     >
     48 struct resolve_bind_arg< arg<N>, U1, U2, U3, U4, U5 >
     49 {
     50     typedef typename apply_wrap5<mpl::arg<N>, U1, U2, U3, U4, U5>::type type;
     51 };
     52 
     53 template<
     54       typename F, typename T1, typename T2, typename T3, typename T4
     55     , typename T5, typename U1, typename U2, typename U3, typename U4
     56     , typename U5
     57     >
     58 struct resolve_bind_arg< bind< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5 >
     59 {
     60     typedef bind< F,T1,T2,T3,T4,T5 > f_;
     61     typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
     62 };
     63 
     64 } // namespace aux
     65 
     66 template<
     67       typename F
     68     >
     69 struct bind0
     70 {
     71     template<
     72           typename U1 = na, typename U2 = na, typename U3 = na
     73         , typename U4 = na, typename U5 = na
     74         >
     75     struct apply
     76     {
     77      private:
     78         typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
     79         typedef typename r0::type a0;
     80         typedef typename r0::next n1;
     81         typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
     82         ///
     83      public:
     84         typedef typename apply_wrap0<
     85               f_
     86             >::type type;
     87 
     88     };
     89 };
     90 
     91 namespace aux {
     92 
     93 template<
     94       typename F, typename U1, typename U2, typename U3, typename U4
     95     , typename U5
     96     >
     97 struct resolve_bind_arg<
     98       bind0<F>, U1, U2, U3, U4, U5
     99     >
    100 {
    101     typedef bind0<F> f_;
    102     typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
    103 };
    104 
    105 } // namespace aux
    106 
    107 BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
    108 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
    109 
    110 template<
    111       typename F
    112     >
    113 struct bind< F,na,na,na,na,na >
    114     : bind0<F>
    115 {
    116 };
    117 
    118 template<
    119       typename F, typename T1
    120     >
    121 struct bind1
    122 {
    123     template<
    124           typename U1 = na, typename U2 = na, typename U3 = na
    125         , typename U4 = na, typename U5 = na
    126         >
    127     struct apply
    128     {
    129      private:
    130         typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
    131         typedef typename r0::type a0;
    132         typedef typename r0::next n1;
    133         typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
    134         ///
    135         typedef aux::replace_unnamed_arg< T1,n1 > r1;
    136         typedef typename r1::type a1;
    137         typedef typename r1::next n2;
    138         typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
    139         ///
    140      public:
    141         typedef typename apply_wrap1<
    142               f_
    143             , typename t1::type
    144             >::type type;
    145 
    146     };
    147 };
    148 
    149 namespace aux {
    150 
    151 template<
    152       typename F, typename T1, typename U1, typename U2, typename U3
    153     , typename U4, typename U5
    154     >
    155 struct resolve_bind_arg<
    156       bind1< F,T1 >, U1, U2, U3, U4, U5
    157     >
    158 {
    159     typedef bind1< F,T1 > f_;
    160     typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
    161 };
    162 
    163 } // namespace aux
    164 
    165 BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
    166 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
    167 
    168 template<
    169       typename F, typename T1
    170     >
    171 struct bind< F,T1,na,na,na,na >
    172     : bind1< F,T1 >
    173 {
    174 };
    175 
    176 template<
    177       typename F, typename T1, typename T2
    178     >
    179 struct bind2
    180 {
    181     template<
    182           typename U1 = na, typename U2 = na, typename U3 = na
    183         , typename U4 = na, typename U5 = na
    184         >
    185     struct apply
    186     {
    187      private:
    188         typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
    189         typedef typename r0::type a0;
    190         typedef typename r0::next n1;
    191         typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
    192         ///
    193         typedef aux::replace_unnamed_arg< T1,n1 > r1;
    194         typedef typename r1::type a1;
    195         typedef typename r1::next n2;
    196         typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
    197         ///
    198         typedef aux::replace_unnamed_arg< T2,n2 > r2;
    199         typedef typename r2::type a2;
    200         typedef typename r2::next n3;
    201         typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
    202         ///
    203      public:
    204         typedef typename apply_wrap2<
    205               f_
    206             , typename t1::type, typename t2::type
    207             >::type type;
    208 
    209     };
    210 };
    211 
    212 namespace aux {
    213 
    214 template<
    215       typename F, typename T1, typename T2, typename U1, typename U2
    216     , typename U3, typename U4, typename U5
    217     >
    218 struct resolve_bind_arg<
    219       bind2< F,T1,T2 >, U1, U2, U3, U4, U5
    220     >
    221 {
    222     typedef bind2< F,T1,T2 > f_;
    223     typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
    224 };
    225 
    226 } // namespace aux
    227 
    228 BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
    229 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
    230 
    231 template<
    232       typename F, typename T1, typename T2
    233     >
    234 struct bind< F,T1,T2,na,na,na >
    235     : bind2< F,T1,T2 >
    236 {
    237 };
    238 
    239 template<
    240       typename F, typename T1, typename T2, typename T3
    241     >
    242 struct bind3
    243 {
    244     template<
    245           typename U1 = na, typename U2 = na, typename U3 = na
    246         , typename U4 = na, typename U5 = na
    247         >
    248     struct apply
    249     {
    250      private:
    251         typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
    252         typedef typename r0::type a0;
    253         typedef typename r0::next n1;
    254         typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
    255         ///
    256         typedef aux::replace_unnamed_arg< T1,n1 > r1;
    257         typedef typename r1::type a1;
    258         typedef typename r1::next n2;
    259         typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
    260         ///
    261         typedef aux::replace_unnamed_arg< T2,n2 > r2;
    262         typedef typename r2::type a2;
    263         typedef typename r2::next n3;
    264         typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
    265         ///
    266         typedef aux::replace_unnamed_arg< T3,n3 > r3;
    267         typedef typename r3::type a3;
    268         typedef typename r3::next n4;
    269         typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
    270         ///
    271      public:
    272         typedef typename apply_wrap3<
    273               f_
    274             , typename t1::type, typename t2::type, typename t3::type
    275             >::type type;
    276 
    277     };
    278 };
    279 
    280 namespace aux {
    281 
    282 template<
    283       typename F, typename T1, typename T2, typename T3, typename U1
    284     , typename U2, typename U3, typename U4, typename U5
    285     >
    286 struct resolve_bind_arg<
    287       bind3< F,T1,T2,T3 >, U1, U2, U3, U4, U5
    288     >
    289 {
    290     typedef bind3< F,T1,T2,T3 > f_;
    291     typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
    292 };
    293 
    294 } // namespace aux
    295 
    296 BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
    297 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
    298 
    299 template<
    300       typename F, typename T1, typename T2, typename T3
    301     >
    302 struct bind< F,T1,T2,T3,na,na >
    303     : bind3< F,T1,T2,T3 >
    304 {
    305 };
    306 
    307 template<
    308       typename F, typename T1, typename T2, typename T3, typename T4
    309     >
    310 struct bind4
    311 {
    312     template<
    313           typename U1 = na, typename U2 = na, typename U3 = na
    314         , typename U4 = na, typename U5 = na
    315         >
    316     struct apply
    317     {
    318      private:
    319         typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
    320         typedef typename r0::type a0;
    321         typedef typename r0::next n1;
    322         typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
    323         ///
    324         typedef aux::replace_unnamed_arg< T1,n1 > r1;
    325         typedef typename r1::type a1;
    326         typedef typename r1::next n2;
    327         typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
    328         ///
    329         typedef aux::replace_unnamed_arg< T2,n2 > r2;
    330         typedef typename r2::type a2;
    331         typedef typename r2::next n3;
    332         typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
    333         ///
    334         typedef aux::replace_unnamed_arg< T3,n3 > r3;
    335         typedef typename r3::type a3;
    336         typedef typename r3::next n4;
    337         typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
    338         ///
    339         typedef aux::replace_unnamed_arg< T4,n4 > r4;
    340         typedef typename r4::type a4;
    341         typedef typename r4::next n5;
    342         typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
    343         ///
    344      public:
    345         typedef typename apply_wrap4<
    346               f_
    347             , typename t1::type, typename t2::type, typename t3::type
    348             , typename t4::type
    349             >::type type;
    350 
    351     };
    352 };
    353 
    354 namespace aux {
    355 
    356 template<
    357       typename F, typename T1, typename T2, typename T3, typename T4
    358     , typename U1, typename U2, typename U3, typename U4, typename U5
    359     >
    360 struct resolve_bind_arg<
    361       bind4< F,T1,T2,T3,T4 >, U1, U2, U3, U4, U5
    362     >
    363 {
    364     typedef bind4< F,T1,T2,T3,T4 > f_;
    365     typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
    366 };
    367 
    368 } // namespace aux
    369 
    370 BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
    371 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
    372 
    373 template<
    374       typename F, typename T1, typename T2, typename T3, typename T4
    375     >
    376 struct bind< F,T1,T2,T3,T4,na >
    377     : bind4< F,T1,T2,T3,T4 >
    378 {
    379 };
    380 
    381 template<
    382       typename F, typename T1, typename T2, typename T3, typename T4
    383     , typename T5
    384     >
    385 struct bind5
    386 {
    387     template<
    388           typename U1 = na, typename U2 = na, typename U3 = na
    389         , typename U4 = na, typename U5 = na
    390         >
    391     struct apply
    392     {
    393      private:
    394         typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
    395         typedef typename r0::type a0;
    396         typedef typename r0::next n1;
    397         typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
    398         ///
    399         typedef aux::replace_unnamed_arg< T1,n1 > r1;
    400         typedef typename r1::type a1;
    401         typedef typename r1::next n2;
    402         typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
    403         ///
    404         typedef aux::replace_unnamed_arg< T2,n2 > r2;
    405         typedef typename r2::type a2;
    406         typedef typename r2::next n3;
    407         typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
    408         ///
    409         typedef aux::replace_unnamed_arg< T3,n3 > r3;
    410         typedef typename r3::type a3;
    411         typedef typename r3::next n4;
    412         typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
    413         ///
    414         typedef aux::replace_unnamed_arg< T4,n4 > r4;
    415         typedef typename r4::type a4;
    416         typedef typename r4::next n5;
    417         typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
    418         ///
    419         typedef aux::replace_unnamed_arg< T5,n5 > r5;
    420         typedef typename r5::type a5;
    421         typedef typename r5::next n6;
    422         typedef aux::resolve_bind_arg< a5,U1,U2,U3,U4,U5 > t5;
    423         ///
    424      public:
    425         typedef typename apply_wrap5<
    426               f_
    427             , typename t1::type, typename t2::type, typename t3::type
    428             , typename t4::type, typename t5::type
    429             >::type type;
    430 
    431     };
    432 };
    433 
    434 namespace aux {
    435 
    436 template<
    437       typename F, typename T1, typename T2, typename T3, typename T4
    438     , typename T5, typename U1, typename U2, typename U3, typename U4
    439     , typename U5
    440     >
    441 struct resolve_bind_arg<
    442       bind5< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5
    443     >
    444 {
    445     typedef bind5< F,T1,T2,T3,T4,T5 > f_;
    446     typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
    447 };
    448 
    449 } // namespace aux
    450 
    451 BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
    452 BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
    453 
    454 /// primary template (not a specialization!)
    455 
    456 template<
    457       typename F, typename T1, typename T2, typename T3, typename T4
    458     , typename T5
    459     >
    460 struct bind
    461     : bind5< F,T1,T2,T3,T4,T5 >
    462 {
    463 };
    464 
    465 /// if_/eval_if specializations
    466 template< template< typename T1, typename T2, typename T3 > class F, typename Tag >
    467 struct quote3;
    468 
    469 template< typename T1, typename T2, typename T3 > struct if_;
    470 
    471 template<
    472       typename Tag, typename T1, typename T2, typename T3
    473     >
    474 struct bind3<
    475       quote3< if_,Tag >
    476     , T1, T2, T3
    477     >
    478 {
    479     template<
    480           typename U1 = na, typename U2 = na, typename U3 = na
    481         , typename U4 = na, typename U5 = na
    482         >
    483     struct apply
    484     {
    485      private:
    486         typedef mpl::arg<1> n1;
    487         typedef aux::replace_unnamed_arg< T1,n1 > r1;
    488         typedef typename r1::type a1;
    489         typedef typename r1::next n2;
    490         typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
    491         ///
    492         typedef aux::replace_unnamed_arg< T2,n2 > r2;
    493         typedef typename r2::type a2;
    494         typedef typename r2::next n3;
    495         typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
    496         ///
    497         typedef aux::replace_unnamed_arg< T3,n3 > r3;
    498         typedef typename r3::type a3;
    499         typedef typename r3::next n4;
    500         typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
    501         ///
    502         typedef typename if_<
    503               typename t1::type
    504             , t2, t3
    505             >::type f_;
    506 
    507      public:
    508         typedef typename f_::type type;
    509     };
    510 };
    511 
    512 template<
    513       template< typename T1, typename T2, typename T3 > class F, typename Tag
    514     >
    515 struct quote3;
    516 
    517 template< typename T1, typename T2, typename T3 > struct eval_if;
    518 
    519 template<
    520       typename Tag, typename T1, typename T2, typename T3
    521     >
    522 struct bind3<
    523       quote3< eval_if,Tag >
    524     , T1, T2, T3
    525     >
    526 {
    527     template<
    528           typename U1 = na, typename U2 = na, typename U3 = na
    529         , typename U4 = na, typename U5 = na
    530         >
    531     struct apply
    532     {
    533      private:
    534         typedef mpl::arg<1> n1;
    535         typedef aux::replace_unnamed_arg< T1,n1 > r1;
    536         typedef typename r1::type a1;
    537         typedef typename r1::next n2;
    538         typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
    539         ///
    540         typedef aux::replace_unnamed_arg< T2,n2 > r2;
    541         typedef typename r2::type a2;
    542         typedef typename r2::next n3;
    543         typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
    544         ///
    545         typedef aux::replace_unnamed_arg< T3,n3 > r3;
    546         typedef typename r3::type a3;
    547         typedef typename r3::next n4;
    548         typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
    549         ///
    550         typedef typename eval_if<
    551               typename t1::type
    552             , t2, t3
    553             >::type f_;
    554 
    555      public:
    556         typedef typename f_::type type;
    557     };
    558 };
    559 
    560 }}
    561 
    562