Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:28

0001     ///////////////////////////////////////////////////////////////////////////////
0002     /// \file call.hpp
0003     /// Contains definition of the call<> transform.
0004     //
0005     //  Copyright 2008 Eric Niebler. Distributed under the Boost
0006     //  Software License, Version 1.0. (See accompanying file
0007     //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0008     
0009     
0010     
0011     template<typename Fun , typename A0>
0012     struct call<Fun(A0...)> : transform<call<Fun(A0...)> >
0013     {
0014         template<typename Expr, typename State, typename Data>
0015         struct impl
0016           : call<
0017                 typename detail::expand_pattern<
0018                     proto::arity_of<Expr>::value 
0019                   , A0
0020                   , detail::expand_pattern_rest_0<
0021                         Fun
0022                         
0023                     >
0024                 >::type
0025             >::template impl<Expr, State, Data>
0026         {};
0027     };
0028     
0029     
0030     
0031     template<typename Fun , typename A0 , typename A1>
0032     struct call<Fun(A0 , A1...)> : transform<call<Fun(A0 , A1...)> >
0033     {
0034         template<typename Expr, typename State, typename Data>
0035         struct impl
0036           : call<
0037                 typename detail::expand_pattern<
0038                     proto::arity_of<Expr>::value 
0039                   , A1
0040                   , detail::expand_pattern_rest_1<
0041                         Fun
0042                         , A0
0043                     >
0044                 >::type
0045             >::template impl<Expr, State, Data>
0046         {};
0047     };
0048     
0049     
0050     
0051     template<typename Fun , typename A0 , typename A1 , typename A2>
0052     struct call<Fun(A0 , A1 , A2...)> : transform<call<Fun(A0 , A1 , A2...)> >
0053     {
0054         template<typename Expr, typename State, typename Data>
0055         struct impl
0056           : call<
0057                 typename detail::expand_pattern<
0058                     proto::arity_of<Expr>::value 
0059                   , A2
0060                   , detail::expand_pattern_rest_2<
0061                         Fun
0062                         , A0 , A1
0063                     >
0064                 >::type
0065             >::template impl<Expr, State, Data>
0066         {};
0067     };
0068     
0069     
0070     
0071     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3>
0072     struct call<Fun(A0 , A1 , A2 , A3)> : transform<call<Fun(A0 , A1 , A2 , A3)> >
0073     {
0074         template<typename Expr, typename State, typename Data>
0075         struct impl : transform_impl<Expr, State, Data>
0076         {
0077             typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3;
0078             typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3)> function_traits;
0079             typedef typename function_traits::result_type result_type;
0080             
0081             
0082             
0083             
0084             
0085             
0086             
0087             BOOST_FORCEINLINE
0088             result_type operator ()(
0089                 typename impl::expr_param e
0090               , typename impl::state_param s
0091               , typename impl::data_param d
0092             ) const
0093             {
0094                 typedef typename function_traits::function_type function_type;
0095                 return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)));
0096             }
0097         };
0098     };
0099     
0100     
0101     
0102     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3>
0103     struct call<Fun(A0 , A1 , A2 , A3...)> : transform<call<Fun(A0 , A1 , A2 , A3...)> >
0104     {
0105         template<typename Expr, typename State, typename Data>
0106         struct impl
0107           : call<
0108                 typename detail::expand_pattern<
0109                     proto::arity_of<Expr>::value 
0110                   , A3
0111                   , detail::expand_pattern_rest_3<
0112                         Fun
0113                         , A0 , A1 , A2
0114                     >
0115                 >::type
0116             >::template impl<Expr, State, Data>
0117         {};
0118     };
0119     
0120     
0121     
0122     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
0123     struct call<Fun(A0 , A1 , A2 , A3 , A4)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4)> >
0124     {
0125         template<typename Expr, typename State, typename Data>
0126         struct impl : transform_impl<Expr, State, Data>
0127         {
0128             typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4;
0129             typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4)> function_traits;
0130             typedef typename function_traits::result_type result_type;
0131             
0132             
0133             
0134             
0135             
0136             
0137             
0138             BOOST_FORCEINLINE
0139             result_type operator ()(
0140                 typename impl::expr_param e
0141               , typename impl::state_param s
0142               , typename impl::data_param d
0143             ) const
0144             {
0145                 typedef typename function_traits::function_type function_type;
0146                 return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)));
0147             }
0148         };
0149     };
0150     
0151     
0152     
0153     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
0154     struct call<Fun(A0 , A1 , A2 , A3 , A4...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4...)> >
0155     {
0156         template<typename Expr, typename State, typename Data>
0157         struct impl
0158           : call<
0159                 typename detail::expand_pattern<
0160                     proto::arity_of<Expr>::value 
0161                   , A4
0162                   , detail::expand_pattern_rest_4<
0163                         Fun
0164                         , A0 , A1 , A2 , A3
0165                     >
0166                 >::type
0167             >::template impl<Expr, State, Data>
0168         {};
0169     };
0170     
0171     
0172     
0173     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
0174     struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5)> >
0175     {
0176         template<typename Expr, typename State, typename Data>
0177         struct impl : transform_impl<Expr, State, Data>
0178         {
0179             typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4; typedef typename when<_, A5>::template impl<Expr, State, Data> a5; typedef typename a5::result_type b5;
0180             typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4 , b5)> function_traits;
0181             typedef typename function_traits::result_type result_type;
0182             
0183             
0184             
0185             
0186             
0187             
0188             
0189             BOOST_FORCEINLINE
0190             result_type operator ()(
0191                 typename impl::expr_param e
0192               , typename impl::state_param s
0193               , typename impl::data_param d
0194             ) const
0195             {
0196                 typedef typename function_traits::function_type function_type;
0197                 return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)) , detail::as_lvalue(a5()(e, s, d)));
0198             }
0199         };
0200     };
0201     
0202     
0203     
0204     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
0205     struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5...)> >
0206     {
0207         template<typename Expr, typename State, typename Data>
0208         struct impl
0209           : call<
0210                 typename detail::expand_pattern<
0211                     proto::arity_of<Expr>::value 
0212                   , A5
0213                   , detail::expand_pattern_rest_5<
0214                         Fun
0215                         , A0 , A1 , A2 , A3 , A4
0216                     >
0217                 >::type
0218             >::template impl<Expr, State, Data>
0219         {};
0220     };
0221     
0222     
0223     
0224     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
0225     struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6)> >
0226     {
0227         template<typename Expr, typename State, typename Data>
0228         struct impl : transform_impl<Expr, State, Data>
0229         {
0230             typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4; typedef typename when<_, A5>::template impl<Expr, State, Data> a5; typedef typename a5::result_type b5; typedef typename when<_, A6>::template impl<Expr, State, Data> a6; typedef typename a6::result_type b6;
0231             typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4 , b5 , b6)> function_traits;
0232             typedef typename function_traits::result_type result_type;
0233             
0234             
0235             
0236             
0237             
0238             
0239             
0240             BOOST_FORCEINLINE
0241             result_type operator ()(
0242                 typename impl::expr_param e
0243               , typename impl::state_param s
0244               , typename impl::data_param d
0245             ) const
0246             {
0247                 typedef typename function_traits::function_type function_type;
0248                 return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)) , detail::as_lvalue(a5()(e, s, d)) , detail::as_lvalue(a6()(e, s, d)));
0249             }
0250         };
0251     };
0252     
0253     
0254     
0255     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
0256     struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6...)> >
0257     {
0258         template<typename Expr, typename State, typename Data>
0259         struct impl
0260           : call<
0261                 typename detail::expand_pattern<
0262                     proto::arity_of<Expr>::value 
0263                   , A6
0264                   , detail::expand_pattern_rest_6<
0265                         Fun
0266                         , A0 , A1 , A2 , A3 , A4 , A5
0267                     >
0268                 >::type
0269             >::template impl<Expr, State, Data>
0270         {};
0271     };
0272     
0273     
0274     
0275     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
0276     struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)> >
0277     {
0278         template<typename Expr, typename State, typename Data>
0279         struct impl : transform_impl<Expr, State, Data>
0280         {
0281             typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4; typedef typename when<_, A5>::template impl<Expr, State, Data> a5; typedef typename a5::result_type b5; typedef typename when<_, A6>::template impl<Expr, State, Data> a6; typedef typename a6::result_type b6; typedef typename when<_, A7>::template impl<Expr, State, Data> a7; typedef typename a7::result_type b7;
0282             typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4 , b5 , b6 , b7)> function_traits;
0283             typedef typename function_traits::result_type result_type;
0284             
0285             
0286             
0287             
0288             
0289             
0290             
0291             BOOST_FORCEINLINE
0292             result_type operator ()(
0293                 typename impl::expr_param e
0294               , typename impl::state_param s
0295               , typename impl::data_param d
0296             ) const
0297             {
0298                 typedef typename function_traits::function_type function_type;
0299                 return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)) , detail::as_lvalue(a5()(e, s, d)) , detail::as_lvalue(a6()(e, s, d)) , detail::as_lvalue(a7()(e, s, d)));
0300             }
0301         };
0302     };
0303     
0304     
0305     
0306     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
0307     struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7...)> >
0308     {
0309         template<typename Expr, typename State, typename Data>
0310         struct impl
0311           : call<
0312                 typename detail::expand_pattern<
0313                     proto::arity_of<Expr>::value 
0314                   , A7
0315                   , detail::expand_pattern_rest_7<
0316                         Fun
0317                         , A0 , A1 , A2 , A3 , A4 , A5 , A6
0318                     >
0319                 >::type
0320             >::template impl<Expr, State, Data>
0321         {};
0322     };
0323     
0324     
0325     
0326     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
0327     struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)> >
0328     {
0329         template<typename Expr, typename State, typename Data>
0330         struct impl : transform_impl<Expr, State, Data>
0331         {
0332             typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4; typedef typename when<_, A5>::template impl<Expr, State, Data> a5; typedef typename a5::result_type b5; typedef typename when<_, A6>::template impl<Expr, State, Data> a6; typedef typename a6::result_type b6; typedef typename when<_, A7>::template impl<Expr, State, Data> a7; typedef typename a7::result_type b7; typedef typename when<_, A8>::template impl<Expr, State, Data> a8; typedef typename a8::result_type b8;
0333             typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4 , b5 , b6 , b7 , b8)> function_traits;
0334             typedef typename function_traits::result_type result_type;
0335             
0336             
0337             
0338             
0339             
0340             
0341             
0342             BOOST_FORCEINLINE
0343             result_type operator ()(
0344                 typename impl::expr_param e
0345               , typename impl::state_param s
0346               , typename impl::data_param d
0347             ) const
0348             {
0349                 typedef typename function_traits::function_type function_type;
0350                 return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)) , detail::as_lvalue(a5()(e, s, d)) , detail::as_lvalue(a6()(e, s, d)) , detail::as_lvalue(a7()(e, s, d)) , detail::as_lvalue(a8()(e, s, d)));
0351             }
0352         };
0353     };
0354     
0355     
0356     
0357     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
0358     struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8...)> >
0359     {
0360         template<typename Expr, typename State, typename Data>
0361         struct impl
0362           : call<
0363                 typename detail::expand_pattern<
0364                     proto::arity_of<Expr>::value 
0365                   , A8
0366                   , detail::expand_pattern_rest_8<
0367                         Fun
0368                         , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7
0369                     >
0370                 >::type
0371             >::template impl<Expr, State, Data>
0372         {};
0373     };
0374     
0375     
0376     
0377     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
0378     struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)> >
0379     {
0380         template<typename Expr, typename State, typename Data>
0381         struct impl : transform_impl<Expr, State, Data>
0382         {
0383             typedef typename when<_, A0>::template impl<Expr, State, Data> a0; typedef typename a0::result_type b0; typedef typename when<_, A1>::template impl<Expr, State, Data> a1; typedef typename a1::result_type b1; typedef typename when<_, A2>::template impl<Expr, State, Data> a2; typedef typename a2::result_type b2; typedef typename when<_, A3>::template impl<Expr, State, Data> a3; typedef typename a3::result_type b3; typedef typename when<_, A4>::template impl<Expr, State, Data> a4; typedef typename a4::result_type b4; typedef typename when<_, A5>::template impl<Expr, State, Data> a5; typedef typename a5::result_type b5; typedef typename when<_, A6>::template impl<Expr, State, Data> a6; typedef typename a6::result_type b6; typedef typename when<_, A7>::template impl<Expr, State, Data> a7; typedef typename a7::result_type b7; typedef typename when<_, A8>::template impl<Expr, State, Data> a8; typedef typename a8::result_type b8; typedef typename when<_, A9>::template impl<Expr, State, Data> a9; typedef typename a9::result_type b9;
0384             typedef detail::poly_function_traits<Fun, Fun(b0 , b1 , b2 , b3 , b4 , b5 , b6 , b7 , b8 , b9)> function_traits;
0385             typedef typename function_traits::result_type result_type;
0386             
0387             
0388             
0389             
0390             
0391             
0392             
0393             BOOST_FORCEINLINE
0394             result_type operator ()(
0395                 typename impl::expr_param e
0396               , typename impl::state_param s
0397               , typename impl::data_param d
0398             ) const
0399             {
0400                 typedef typename function_traits::function_type function_type;
0401                 return function_type()(detail::as_lvalue(a0()(e, s, d)) , detail::as_lvalue(a1()(e, s, d)) , detail::as_lvalue(a2()(e, s, d)) , detail::as_lvalue(a3()(e, s, d)) , detail::as_lvalue(a4()(e, s, d)) , detail::as_lvalue(a5()(e, s, d)) , detail::as_lvalue(a6()(e, s, d)) , detail::as_lvalue(a7()(e, s, d)) , detail::as_lvalue(a8()(e, s, d)) , detail::as_lvalue(a9()(e, s, d)));
0402             }
0403         };
0404     };
0405     
0406     
0407     
0408     template<typename Fun , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
0409     struct call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9...)> : transform<call<Fun(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9...)> >
0410     {
0411         template<typename Expr, typename State, typename Data>
0412         struct impl
0413           : call<
0414                 typename detail::expand_pattern<
0415                     proto::arity_of<Expr>::value 
0416                   , A9
0417                   , detail::expand_pattern_rest_9<
0418                         Fun
0419                         , A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8
0420                     >
0421                 >::type
0422             >::template impl<Expr, State, Data>
0423         {};
0424     };