Back to home page

EIC code displayed by LXR

 
 

    


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

0001     ///////////////////////////////////////////////////////////////////////////////
0002     // poly_function_funop.hpp
0003     // Contains overloads of poly_function\<\>::operator()
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     template<typename This , typename A0>
0009     struct result<This(A0)>
0010       : Derived::template impl<
0011             typename normalize_arg<A0 >::type
0012         >
0013     {
0014         typedef typename result::result_type type;
0015     };
0016     template<typename A0>
0017     typename result<
0018         Derived const(
0019             A0 const &
0020         )
0021     >::type
0022     operator ()(A0 const &a0) const
0023     {
0024         result<
0025             Derived const(
0026                 A0 const &
0027             )
0028         > impl;
0029         return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0));
0030     }
0031     template<typename This , typename A0 , typename A1>
0032     struct result<This(A0 , A1)>
0033       : Derived::template impl<
0034             typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type
0035         >
0036     {
0037         typedef typename result::result_type type;
0038     };
0039     template<typename A0 , typename A1>
0040     typename result<
0041         Derived const(
0042             A0 const & , A1 const &
0043         )
0044     >::type
0045     operator ()(A0 const &a0 , A1 const &a1) const
0046     {
0047         result<
0048             Derived const(
0049                 A0 const & , A1 const &
0050             )
0051         > impl;
0052         return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1));
0053     }
0054     template<typename This , typename A0 , typename A1 , typename A2>
0055     struct result<This(A0 , A1 , A2)>
0056       : Derived::template impl<
0057             typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type
0058         >
0059     {
0060         typedef typename result::result_type type;
0061     };
0062     template<typename A0 , typename A1 , typename A2>
0063     typename result<
0064         Derived const(
0065             A0 const & , A1 const & , A2 const &
0066         )
0067     >::type
0068     operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2) const
0069     {
0070         result<
0071             Derived const(
0072                 A0 const & , A1 const & , A2 const &
0073             )
0074         > impl;
0075         return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2));
0076     }
0077     template<typename This , typename A0 , typename A1 , typename A2 , typename A3>
0078     struct result<This(A0 , A1 , A2 , A3)>
0079       : Derived::template impl<
0080             typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type
0081         >
0082     {
0083         typedef typename result::result_type type;
0084     };
0085     template<typename A0 , typename A1 , typename A2 , typename A3>
0086     typename result<
0087         Derived const(
0088             A0 const & , A1 const & , A2 const & , A3 const &
0089         )
0090     >::type
0091     operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3) const
0092     {
0093         result<
0094             Derived const(
0095                 A0 const & , A1 const & , A2 const & , A3 const &
0096             )
0097         > impl;
0098         return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3));
0099     }
0100     template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
0101     struct result<This(A0 , A1 , A2 , A3 , A4)>
0102       : Derived::template impl<
0103             typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type
0104         >
0105     {
0106         typedef typename result::result_type type;
0107     };
0108     template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
0109     typename result<
0110         Derived const(
0111             A0 const & , A1 const & , A2 const & , A3 const & , A4 const &
0112         )
0113     >::type
0114     operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4) const
0115     {
0116         result<
0117             Derived const(
0118                 A0 const & , A1 const & , A2 const & , A3 const & , A4 const &
0119             )
0120         > impl;
0121         return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4));
0122     }
0123     template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
0124     struct result<This(A0 , A1 , A2 , A3 , A4 , A5)>
0125       : Derived::template impl<
0126             typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type
0127         >
0128     {
0129         typedef typename result::result_type type;
0130     };
0131     template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
0132     typename result<
0133         Derived const(
0134             A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const &
0135         )
0136     >::type
0137     operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5) const
0138     {
0139         result<
0140             Derived const(
0141                 A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const &
0142             )
0143         > impl;
0144         return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5));
0145     }
0146     template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
0147     struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6)>
0148       : Derived::template impl<
0149             typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type
0150         >
0151     {
0152         typedef typename result::result_type type;
0153     };
0154     template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
0155     typename result<
0156         Derived const(
0157             A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const &
0158         )
0159     >::type
0160     operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6) const
0161     {
0162         result<
0163             Derived const(
0164                 A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const &
0165             )
0166         > impl;
0167         return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6));
0168     }
0169     template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
0170     struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7)>
0171       : Derived::template impl<
0172             typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type , typename normalize_arg<A7 >::type
0173         >
0174     {
0175         typedef typename result::result_type type;
0176     };
0177     template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
0178     typename result<
0179         Derived const(
0180             A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const &
0181         )
0182     >::type
0183     operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7) const
0184     {
0185         result<
0186             Derived const(
0187                 A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const &
0188             )
0189         > impl;
0190         return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6) , static_cast<typename normalize_arg<A7 const &> ::reference>(a7));
0191     }
0192     template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
0193     struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8)>
0194       : Derived::template impl<
0195             typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type , typename normalize_arg<A7 >::type , typename normalize_arg<A8 >::type
0196         >
0197     {
0198         typedef typename result::result_type type;
0199     };
0200     template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
0201     typename result<
0202         Derived const(
0203             A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const &
0204         )
0205     >::type
0206     operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8) const
0207     {
0208         result<
0209             Derived const(
0210                 A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const &
0211             )
0212         > impl;
0213         return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6) , static_cast<typename normalize_arg<A7 const &> ::reference>(a7) , static_cast<typename normalize_arg<A8 const &> ::reference>(a8));
0214     }
0215     template<typename This , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
0216     struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9)>
0217       : Derived::template impl<
0218             typename normalize_arg<A0 >::type , typename normalize_arg<A1 >::type , typename normalize_arg<A2 >::type , typename normalize_arg<A3 >::type , typename normalize_arg<A4 >::type , typename normalize_arg<A5 >::type , typename normalize_arg<A6 >::type , typename normalize_arg<A7 >::type , typename normalize_arg<A8 >::type , typename normalize_arg<A9 >::type
0219         >
0220     {
0221         typedef typename result::result_type type;
0222     };
0223     template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
0224     typename result<
0225         Derived const(
0226             A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const & , A9 const &
0227         )
0228     >::type
0229     operator ()(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8 , A9 const &a9) const
0230     {
0231         result<
0232             Derived const(
0233                 A0 const & , A1 const & , A2 const & , A3 const & , A4 const & , A5 const & , A6 const & , A7 const & , A8 const & , A9 const &
0234             )
0235         > impl;
0236         return impl(static_cast<typename normalize_arg<A0 const &> ::reference>(a0) , static_cast<typename normalize_arg<A1 const &> ::reference>(a1) , static_cast<typename normalize_arg<A2 const &> ::reference>(a2) , static_cast<typename normalize_arg<A3 const &> ::reference>(a3) , static_cast<typename normalize_arg<A4 const &> ::reference>(a4) , static_cast<typename normalize_arg<A5 const &> ::reference>(a5) , static_cast<typename normalize_arg<A6 const &> ::reference>(a6) , static_cast<typename normalize_arg<A7 const &> ::reference>(a7) , static_cast<typename normalize_arg<A8 const &> ::reference>(a8) , static_cast<typename normalize_arg<A9 const &> ::reference>(a9));
0237     }