Chris@16
|
1 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
|
Chris@16
|
2
|
Chris@16
|
3 #include <boost/proto/detail/preprocessed/funop.hpp>
|
Chris@16
|
4
|
Chris@16
|
5 #elif !defined(BOOST_PP_IS_ITERATING)
|
Chris@16
|
6
|
Chris@16
|
7 #define BOOST_PROTO_AS_CHILD_TYPE(Z, N, DATA) \
|
Chris@16
|
8 typename proto::result_of::as_child<BOOST_PP_CAT(A, N), Domain>::type \
|
Chris@16
|
9 /**/
|
Chris@16
|
10
|
Chris@16
|
11 #define BOOST_PROTO_AS_CHILD(Z, N, DATA) \
|
Chris@16
|
12 proto::as_child<Domain>(BOOST_PP_CAT(a, N)) \
|
Chris@16
|
13 /**/
|
Chris@16
|
14
|
Chris@16
|
15 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
16 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/funop.hpp")
|
Chris@16
|
17 #endif
|
Chris@16
|
18
|
Chris@16
|
19 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
20 // funop.hpp
|
Chris@16
|
21 // Contains definition of funop[n]\<\> class template.
|
Chris@16
|
22 //
|
Chris@16
|
23 // Copyright 2008 Eric Niebler. Distributed under the Boost
|
Chris@16
|
24 // Software License, Version 1.0. (See accompanying file
|
Chris@16
|
25 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
26
|
Chris@16
|
27 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
28 #pragma wave option(preserve: 1)
|
Chris@16
|
29 #endif
|
Chris@16
|
30
|
Chris@16
|
31 #define BOOST_PP_ITERATION_PARAMS_1 \
|
Chris@16
|
32 (3, (0, BOOST_PP_DEC(BOOST_PROTO_MAX_FUNCTION_CALL_ARITY), <boost/proto/detail/funop.hpp>))
|
Chris@16
|
33 #include BOOST_PP_ITERATE()
|
Chris@16
|
34
|
Chris@16
|
35 #undef BOOST_PROTO_AS_CHILD
|
Chris@16
|
36 #undef BOOST_PROTO_AS_CHILD_TYPE
|
Chris@16
|
37
|
Chris@16
|
38 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
Chris@16
|
39 #pragma wave option(output: null)
|
Chris@16
|
40 #endif
|
Chris@16
|
41
|
Chris@16
|
42 #else
|
Chris@16
|
43
|
Chris@16
|
44 /// \brief A helper metafunction for computing the
|
Chris@16
|
45 /// return type of \c proto::expr\<\>::operator().
|
Chris@16
|
46 template<typename Expr, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename A)>
|
Chris@16
|
47 struct BOOST_PP_CAT(funop, BOOST_PP_ITERATION())
|
Chris@16
|
48 {
|
Chris@16
|
49 typedef typename proto::base_expr<
|
Chris@16
|
50 Domain
|
Chris@16
|
51 , tag::function
|
Chris@16
|
52 , BOOST_PP_CAT(list, BOOST_PP_INC(BOOST_PP_ITERATION()))<
|
Chris@16
|
53 Expr &
|
Chris@16
|
54 BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), BOOST_PROTO_AS_CHILD_TYPE, ~)
|
Chris@16
|
55 >
|
Chris@16
|
56 >::type type;
|
Chris@16
|
57
|
Chris@16
|
58 BOOST_FORCEINLINE
|
Chris@16
|
59 static type const call(
|
Chris@16
|
60 Expr &e
|
Chris@16
|
61 BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(BOOST_PP_ITERATION(), A, &a)
|
Chris@16
|
62 )
|
Chris@16
|
63 {
|
Chris@16
|
64 type that = {
|
Chris@16
|
65 e
|
Chris@16
|
66 BOOST_PP_ENUM_TRAILING(BOOST_PP_ITERATION(), BOOST_PROTO_AS_CHILD, ~)
|
Chris@16
|
67 };
|
Chris@16
|
68 return that;
|
Chris@16
|
69 }
|
Chris@16
|
70 };
|
Chris@16
|
71
|
Chris@16
|
72 /// \brief A helper metafunction for computing the
|
Chris@16
|
73 /// return type of \c proto::expr\<\>::operator().
|
Chris@16
|
74 template<typename Expr BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename A), typename This, typename Domain>
|
Chris@16
|
75 struct funop<Expr(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), A)), This, Domain>
|
Chris@16
|
76 : BOOST_PP_CAT(funop, BOOST_PP_ITERATION())<
|
Chris@16
|
77 typename detail::same_cv<Expr, This>::type
|
Chris@16
|
78 , Domain
|
Chris@16
|
79 BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
|
Chris@16
|
80 BOOST_PP_ITERATION()
|
Chris@16
|
81 , typename remove_reference<A
|
Chris@16
|
82 , >::type BOOST_PP_INTERCEPT
|
Chris@16
|
83 )
|
Chris@16
|
84 >
|
Chris@16
|
85 {};
|
Chris@16
|
86
|
Chris@16
|
87 #endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES
|