1 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
3 #include <boost/proto/detail/preprocessed/make_expr_.hpp>
5 #elif !defined(BOOST_PP_IS_ITERATING)
7 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
8 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_expr_.hpp")
11 ///////////////////////////////////////////////////////////////////////////////
12 /// \file make_expr_.hpp
13 /// Contains definition of make_expr_\<\> class template.
15 // Copyright 2008 Eric Niebler. Distributed under the Boost
16 // Software License, Version 1.0. (See accompanying file
17 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
19 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
20 #pragma wave option(preserve: 1)
26 BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
29 , = void BOOST_PP_INTERCEPT
36 template<typename Domain, typename A>
37 struct make_expr_<tag::terminal, Domain, A
38 BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
40 typedef typename proto::detail::protoify<A, Domain>::result_type result_type;
43 result_type operator()(typename add_reference<A>::type a) const
45 return proto::detail::protoify<A, Domain>()(a);
50 struct make_expr_<tag::terminal, deduce_domain, A
51 BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, void BOOST_PP_INTERCEPT)>
52 : make_expr_<tag::terminal, default_domain, A>
55 #define BOOST_PP_ITERATION_PARAMS_1 \
56 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/make_expr_.hpp>))
57 #include BOOST_PP_ITERATE()
59 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
60 #pragma wave option(output: null)
63 #else // BOOST_PP_IS_ITERATING
65 #define N BOOST_PP_ITERATION()
66 #define M BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N)
68 template<typename Tag, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
69 struct make_expr_<Tag, Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
70 BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
73 BOOST_PP_CAT(list, N)<
74 BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD_TYPE, (A, ~, Domain))
78 typedef typename base_expr<Domain, Tag, proto_args>::type expr_type;
79 typedef typename Domain::proto_generator proto_generator;
80 typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
83 result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference<A, >::type a)) const
85 expr_type const that = {
86 BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD, (A, a, Domain))
88 return proto_generator()(that);
92 template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
93 struct make_expr_<Tag, deduce_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
94 BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
97 , typename BOOST_PP_CAT(deduce_domain, N)<BOOST_PP_ENUM_PARAMS(N, A)>::type
98 BOOST_PP_ENUM_TRAILING_PARAMS(N, A)