Back to home page

EIC code displayed by LXR

 
 

    


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

0001     ///////////////////////////////////////////////////////////////////////////////
0002     /// \file deep_copy.hpp
0003     /// Replace all nodes stored by reference by nodes stored by value.
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 Expr>
0009     struct deep_copy_impl<Expr, 1>
0010     {
0011         typedef
0012             typename base_expr<
0013                 typename Expr::proto_domain
0014               , typename Expr::proto_tag
0015               , list1<
0016                     typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type
0017                 >
0018             >::type
0019         expr_type;
0020         typedef typename Expr::proto_generator proto_generator;
0021         typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
0022         template<typename Expr2, typename S, typename D>
0023         result_type operator()(Expr2 const &e, S const &, D const &) const
0024         {
0025             expr_type const that = {
0026                 proto::deep_copy(e.proto_base().child0)
0027             };
0028             return proto_generator()(that);
0029         }
0030     };
0031     template<typename Expr>
0032     struct deep_copy_impl<Expr, 2>
0033     {
0034         typedef
0035             typename base_expr<
0036                 typename Expr::proto_domain
0037               , typename Expr::proto_tag
0038               , list2<
0039                     typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type
0040                 >
0041             >::type
0042         expr_type;
0043         typedef typename Expr::proto_generator proto_generator;
0044         typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
0045         template<typename Expr2, typename S, typename D>
0046         result_type operator()(Expr2 const &e, S const &, D const &) const
0047         {
0048             expr_type const that = {
0049                 proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1)
0050             };
0051             return proto_generator()(that);
0052         }
0053     };
0054     template<typename Expr>
0055     struct deep_copy_impl<Expr, 3>
0056     {
0057         typedef
0058             typename base_expr<
0059                 typename Expr::proto_domain
0060               , typename Expr::proto_tag
0061               , list3<
0062                     typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type
0063                 >
0064             >::type
0065         expr_type;
0066         typedef typename Expr::proto_generator proto_generator;
0067         typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
0068         template<typename Expr2, typename S, typename D>
0069         result_type operator()(Expr2 const &e, S const &, D const &) const
0070         {
0071             expr_type const that = {
0072                 proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2)
0073             };
0074             return proto_generator()(that);
0075         }
0076     };
0077     template<typename Expr>
0078     struct deep_copy_impl<Expr, 4>
0079     {
0080         typedef
0081             typename base_expr<
0082                 typename Expr::proto_domain
0083               , typename Expr::proto_tag
0084               , list4<
0085                     typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type
0086                 >
0087             >::type
0088         expr_type;
0089         typedef typename Expr::proto_generator proto_generator;
0090         typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
0091         template<typename Expr2, typename S, typename D>
0092         result_type operator()(Expr2 const &e, S const &, D const &) const
0093         {
0094             expr_type const that = {
0095                 proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3)
0096             };
0097             return proto_generator()(that);
0098         }
0099     };
0100     template<typename Expr>
0101     struct deep_copy_impl<Expr, 5>
0102     {
0103         typedef
0104             typename base_expr<
0105                 typename Expr::proto_domain
0106               , typename Expr::proto_tag
0107               , list5<
0108                     typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type
0109                 >
0110             >::type
0111         expr_type;
0112         typedef typename Expr::proto_generator proto_generator;
0113         typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
0114         template<typename Expr2, typename S, typename D>
0115         result_type operator()(Expr2 const &e, S const &, D const &) const
0116         {
0117             expr_type const that = {
0118                 proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4)
0119             };
0120             return proto_generator()(that);
0121         }
0122     };
0123     template<typename Expr>
0124     struct deep_copy_impl<Expr, 6>
0125     {
0126         typedef
0127             typename base_expr<
0128                 typename Expr::proto_domain
0129               , typename Expr::proto_tag
0130               , list6<
0131                     typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child5 >::type::proto_derived_expr >::result_type
0132                 >
0133             >::type
0134         expr_type;
0135         typedef typename Expr::proto_generator proto_generator;
0136         typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
0137         template<typename Expr2, typename S, typename D>
0138         result_type operator()(Expr2 const &e, S const &, D const &) const
0139         {
0140             expr_type const that = {
0141                 proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4) , proto::deep_copy(e.proto_base().child5)
0142             };
0143             return proto_generator()(that);
0144         }
0145     };
0146     template<typename Expr>
0147     struct deep_copy_impl<Expr, 7>
0148     {
0149         typedef
0150             typename base_expr<
0151                 typename Expr::proto_domain
0152               , typename Expr::proto_tag
0153               , list7<
0154                     typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child5 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child6 >::type::proto_derived_expr >::result_type
0155                 >
0156             >::type
0157         expr_type;
0158         typedef typename Expr::proto_generator proto_generator;
0159         typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
0160         template<typename Expr2, typename S, typename D>
0161         result_type operator()(Expr2 const &e, S const &, D const &) const
0162         {
0163             expr_type const that = {
0164                 proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4) , proto::deep_copy(e.proto_base().child5) , proto::deep_copy(e.proto_base().child6)
0165             };
0166             return proto_generator()(that);
0167         }
0168     };
0169     template<typename Expr>
0170     struct deep_copy_impl<Expr, 8>
0171     {
0172         typedef
0173             typename base_expr<
0174                 typename Expr::proto_domain
0175               , typename Expr::proto_tag
0176               , list8<
0177                     typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child5 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child6 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child7 >::type::proto_derived_expr >::result_type
0178                 >
0179             >::type
0180         expr_type;
0181         typedef typename Expr::proto_generator proto_generator;
0182         typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
0183         template<typename Expr2, typename S, typename D>
0184         result_type operator()(Expr2 const &e, S const &, D const &) const
0185         {
0186             expr_type const that = {
0187                 proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4) , proto::deep_copy(e.proto_base().child5) , proto::deep_copy(e.proto_base().child6) , proto::deep_copy(e.proto_base().child7)
0188             };
0189             return proto_generator()(that);
0190         }
0191     };
0192     template<typename Expr>
0193     struct deep_copy_impl<Expr, 9>
0194     {
0195         typedef
0196             typename base_expr<
0197                 typename Expr::proto_domain
0198               , typename Expr::proto_tag
0199               , list9<
0200                     typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child5 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child6 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child7 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child8 >::type::proto_derived_expr >::result_type
0201                 >
0202             >::type
0203         expr_type;
0204         typedef typename Expr::proto_generator proto_generator;
0205         typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
0206         template<typename Expr2, typename S, typename D>
0207         result_type operator()(Expr2 const &e, S const &, D const &) const
0208         {
0209             expr_type const that = {
0210                 proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4) , proto::deep_copy(e.proto_base().child5) , proto::deep_copy(e.proto_base().child6) , proto::deep_copy(e.proto_base().child7) , proto::deep_copy(e.proto_base().child8)
0211             };
0212             return proto_generator()(that);
0213         }
0214     };
0215     template<typename Expr>
0216     struct deep_copy_impl<Expr, 10>
0217     {
0218         typedef
0219             typename base_expr<
0220                 typename Expr::proto_domain
0221               , typename Expr::proto_tag
0222               , list10<
0223                     typename deep_copy_impl< typename remove_reference< typename Expr::proto_child0 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child1 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child2 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child3 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child4 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child5 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child6 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child7 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child8 >::type::proto_derived_expr >::result_type , typename deep_copy_impl< typename remove_reference< typename Expr::proto_child9 >::type::proto_derived_expr >::result_type
0224                 >
0225             >::type
0226         expr_type;
0227         typedef typename Expr::proto_generator proto_generator;
0228         typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
0229         template<typename Expr2, typename S, typename D>
0230         result_type operator()(Expr2 const &e, S const &, D const &) const
0231         {
0232             expr_type const that = {
0233                 proto::deep_copy(e.proto_base().child0) , proto::deep_copy(e.proto_base().child1) , proto::deep_copy(e.proto_base().child2) , proto::deep_copy(e.proto_base().child3) , proto::deep_copy(e.proto_base().child4) , proto::deep_copy(e.proto_base().child5) , proto::deep_copy(e.proto_base().child6) , proto::deep_copy(e.proto_base().child7) , proto::deep_copy(e.proto_base().child8) , proto::deep_copy(e.proto_base().child9)
0234             };
0235             return proto_generator()(that);
0236         }
0237     };