File indexing completed on 2025-01-18 09:50:26
0001 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
0002
0003 #include <boost/proto/detail/preprocessed/deep_copy.hpp>
0004
0005 #elif !defined(BOOST_PP_IS_ITERATING)
0006
0007 #define BOOST_PROTO_DEFINE_DEEP_COPY_TYPE(Z, N, DATA) \
0008 typename deep_copy_impl< \
0009 typename remove_reference< \
0010 typename Expr::BOOST_PP_CAT(proto_child, N) \
0011 >::type::proto_derived_expr \
0012 >::result_type \
0013
0014
0015 #define BOOST_PROTO_DEFINE_DEEP_COPY_FUN(Z, N, DATA) \
0016 proto::deep_copy(e.proto_base().BOOST_PP_CAT(child, N)) \
0017
0018
0019 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0020 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/deep_copy.hpp")
0021 #endif
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0032 #pragma wave option(preserve: 1)
0033 #endif
0034
0035 #define BOOST_PP_ITERATION_PARAMS_1 \
0036 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/deep_copy.hpp>))
0037 #include BOOST_PP_ITERATE()
0038
0039 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
0040 #pragma wave option(output: null)
0041 #endif
0042
0043 #undef BOOST_PROTO_DEFINE_DEEP_COPY_FUN
0044 #undef BOOST_PROTO_DEFINE_DEEP_COPY_TYPE
0045
0046 #else
0047
0048 #define N BOOST_PP_ITERATION()
0049
0050 template<typename Expr>
0051 struct deep_copy_impl<Expr, N>
0052 {
0053 typedef
0054 typename base_expr<
0055 typename Expr::proto_domain
0056 , typename Expr::proto_tag
0057 , BOOST_PP_CAT(list, N)<
0058 BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_TYPE, ~)
0059 >
0060 >::type
0061 expr_type;
0062
0063 typedef typename Expr::proto_generator proto_generator;
0064 typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
0065
0066 template<typename Expr2, typename S, typename D>
0067 result_type operator()(Expr2 const &e, S const &, D const &) const
0068 {
0069 expr_type const that = {
0070 BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_FUN, ~)
0071 };
0072
0073 return proto_generator()(that);
0074 }
0075 };
0076
0077 #undef N
0078
0079 #endif