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