1 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
3 #include <boost/proto/detail/preprocessed/deep_copy.hpp>
5 #elif !defined(BOOST_PP_IS_ITERATING)
7 #define BOOST_PROTO_DEFINE_DEEP_COPY_TYPE(Z, N, DATA) \
8 typename deep_copy_impl< \
9 typename remove_reference< \
10 typename Expr::BOOST_PP_CAT(proto_child, N) \
11 >::type::proto_derived_expr \
15 #define BOOST_PROTO_DEFINE_DEEP_COPY_FUN(Z, N, DATA) \
16 proto::deep_copy(e.proto_base().BOOST_PP_CAT(child, N)) \
19 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
20 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/deep_copy.hpp")
23 ///////////////////////////////////////////////////////////////////////////////
24 /// \file deep_copy.hpp
25 /// Replace all nodes stored by reference by nodes stored by value.
27 // Copyright 2008 Eric Niebler. Distributed under the Boost
28 // Software License, Version 1.0. (See accompanying file
29 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
31 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
32 #pragma wave option(preserve: 1)
35 #define BOOST_PP_ITERATION_PARAMS_1 \
36 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/deep_copy.hpp>))
37 #include BOOST_PP_ITERATE()
39 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
40 #pragma wave option(output: null)
43 #undef BOOST_PROTO_DEFINE_DEEP_COPY_FUN
44 #undef BOOST_PROTO_DEFINE_DEEP_COPY_TYPE
48 #define N BOOST_PP_ITERATION()
50 template<typename Expr>
51 struct deep_copy_impl<Expr, N>
55 typename Expr::proto_domain
56 , typename Expr::proto_tag
57 , BOOST_PP_CAT(list, N)<
58 BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_TYPE, ~)
63 typedef typename Expr::proto_generator proto_generator;
64 typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
66 template<typename Expr2, typename S, typename D>
67 result_type operator()(Expr2 const &e, S const &, D const &) const
69 expr_type const that = {
70 BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_FUN, ~)
73 return proto_generator()(that);