Chris@16: #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) Chris@16: Chris@16: #include Chris@16: Chris@16: #elif !defined(BOOST_PP_IS_ITERATING) Chris@16: Chris@16: #define BOOST_PROTO_DEFINE_DEEP_COPY_TYPE(Z, N, DATA) \ Chris@16: typename deep_copy_impl< \ Chris@16: typename remove_reference< \ Chris@16: typename Expr::BOOST_PP_CAT(proto_child, N) \ Chris@16: >::type::proto_derived_expr \ Chris@16: >::result_type \ Chris@16: /**/ Chris@16: Chris@16: #define BOOST_PROTO_DEFINE_DEEP_COPY_FUN(Z, N, DATA) \ Chris@16: proto::deep_copy(e.proto_base().BOOST_PP_CAT(child, N)) \ Chris@16: /**/ Chris@16: Chris@16: #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(preserve: 2, line: 0, output: "preprocessed/deep_copy.hpp") Chris@16: #endif Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: /// \file deep_copy.hpp Chris@16: /// Replace all nodes stored by reference by nodes stored by value. Chris@16: // Chris@16: // Copyright 2008 Eric Niebler. Distributed under the Boost Chris@16: // Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(preserve: 1) Chris@16: #endif Chris@16: Chris@16: #define BOOST_PP_ITERATION_PARAMS_1 \ Chris@16: (3, (1, BOOST_PROTO_MAX_ARITY, )) Chris@16: #include BOOST_PP_ITERATE() Chris@16: Chris@16: #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(output: null) Chris@16: #endif Chris@16: Chris@16: #undef BOOST_PROTO_DEFINE_DEEP_COPY_FUN Chris@16: #undef BOOST_PROTO_DEFINE_DEEP_COPY_TYPE Chris@16: Chris@16: #else Chris@16: Chris@16: #define N BOOST_PP_ITERATION() Chris@16: Chris@16: template Chris@16: struct deep_copy_impl Chris@16: { Chris@16: typedef Chris@16: typename base_expr< Chris@16: typename Expr::proto_domain Chris@16: , typename Expr::proto_tag Chris@16: , BOOST_PP_CAT(list, N)< Chris@16: BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_TYPE, ~) Chris@16: > Chris@16: >::type Chris@16: expr_type; Chris@16: Chris@16: typedef typename Expr::proto_generator proto_generator; Chris@16: typedef typename proto_generator::template result::type result_type; Chris@16: Chris@16: template Chris@16: result_type operator()(Expr2 const &e, S const &, D const &) const Chris@16: { Chris@16: expr_type const that = { Chris@16: BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_FUN, ~) Chris@16: }; Chris@16: Chris@16: return proto_generator()(that); Chris@16: } Chris@16: }; Chris@16: Chris@16: #undef N Chris@16: Chris@16: #endif