PageRenderTime 35ms CodeModel.GetById 17ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/proto/transform/detail/pass_through_impl.hpp

http://hadesmem.googlecode.com/
C++ Header | 95 lines | 63 code | 18 blank | 14 comment | 3 complexity | 73ae56644c1d2dee846404de559a6e5d MD5 | raw file
 1#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
 2
 3    #include <boost/proto/transform/detail/preprocessed/pass_through_impl.hpp>
 4
 5#elif !defined(BOOST_PP_IS_ITERATING)
 6
 7    #define BOOST_PROTO_DEFINE_TRANSFORM_TYPE(Z, N, DATA)                                   \
 8        typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl<                      \
 9            typename result_of::child_c<Expr, N>::type                                      \
10          , State                                                                           \
11          , Data                                                                            \
12        >::result_type                                                                      \
13        /**/
14
15    #define BOOST_PROTO_DEFINE_TRANSFORM(Z, N, DATA)                                        \
16        typename Grammar::BOOST_PP_CAT(proto_child, N)::template impl<                      \
17            typename result_of::child_c<Expr, N>::type                                      \
18          , State                                                                           \
19          , Data                                                                            \
20        >()(                                                                                \
21            e.proto_base().BOOST_PP_CAT(child, N), s, d                                     \
22        )                                                                                   \
23        /**/
24
25    #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
26        #pragma wave option(preserve: 2, line: 0, output: "preprocessed/pass_through_impl.hpp")
27    #endif
28
29    ///////////////////////////////////////////////////////////////////////////////
30    /// \file pass_through_impl.hpp
31    ///
32    /// Specializations of pass_through_impl, used in the implementation of the
33    /// pass_through transform.
34    //
35    //  Copyright 2008 Eric Niebler. Distributed under the Boost
36    //  Software License, Version 1.0. (See accompanying file
37    //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
38
39    #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
40        #pragma wave option(preserve: 1)
41    #endif
42
43    #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/pass_through_impl.hpp>))
44    #include BOOST_PP_ITERATE()
45
46    #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
47        #pragma wave option(output: null)
48    #endif
49
50    #undef BOOST_PROTO_DEFINE_TRANSFORM
51    #undef BOOST_PROTO_DEFINE_TRANSFORM_TYPE
52
53#else
54
55    #define N BOOST_PP_ITERATION()
56
57    template<typename Grammar, typename Expr, typename State, typename Data>
58    struct pass_through_impl<Grammar, Expr, State, Data, N>
59      : transform_impl<Expr, State, Data>
60    {
61        typedef typename pass_through_impl::expr unref_expr;
62
63        typedef
64            typename base_expr<
65                typename unref_expr::proto_domain
66              , typename unref_expr::proto_tag
67              , BOOST_PP_CAT(list, N)<
68                    BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM_TYPE, ~)
69                >
70            >::type
71        expr_type;
72
73        typedef typename unref_expr::proto_generator proto_generator;
74        typedef typename BOOST_PROTO_RESULT_OF<proto_generator(expr_type)>::type const result_type;
75
76        result_type const operator ()(
77            typename pass_through_impl::expr_param e
78          , typename pass_through_impl::state_param s
79          , typename pass_through_impl::data_param d
80        ) const
81        {
82            expr_type const that = {
83                BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_TRANSFORM, ~)
84            };
85            // Without this, MSVC complains that "that" is uninitialized,
86            // and it actually triggers a runtime check in debug mode when
87            // built with VC8.
88            detail::ignore_unused(&that);
89            return proto_generator()(that);
90        }
91    };
92
93    #undef N
94
95#endif