1 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) 2 3 #include <boost/proto/detail/preprocessed/poly_function_funop.hpp> 4 5 #elif !defined(BOOST_PP_IS_ITERATING) 6 7 #define BOOST_PROTO_NORMALIZE_ARG(Z, N, DATA) \ 8 static_cast<typename normalize_arg<BOOST_PP_CAT(A, N) const &> \ 9 ::reference>(BOOST_PP_CAT(a, N)) \ 10 /**/ 11 12 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) 13 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/poly_function_funop.hpp") 14 #endif 15 16 /////////////////////////////////////////////////////////////////////////////// 17 // poly_function_funop.hpp 18 // Contains overloads of poly_function\<\>::operator() 19 // 20 // Copyright 2008 Eric Niebler. Distributed under the Boost 21 // Software License, Version 1.0. (See accompanying file 22 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 23 24 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) 25 #pragma wave option(preserve: 1) 26 #endif 27 28 #define BOOST_PP_ITERATION_PARAMS_1 \ 29 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/poly_function_funop.hpp>)) 30 #include BOOST_PP_ITERATE() 31 32 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) 33 #pragma wave option(output: null) 34 #endif 35 36 #undef BOOST_PROTO_NORMALIZE_ARG 37 38 #else 39 40 #define N BOOST_PP_ITERATION() 41 42 template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> 43 struct result<This(BOOST_PP_ENUM_PARAMS(N, A))> 44 : Derived::template impl< 45 BOOST_PP_ENUM_BINARY_PARAMS( 46 N 47 , typename normalize_arg<A 48 , >::type BOOST_PP_INTERCEPT 49 ) 50 > 51 { 52 typedef typename result::result_type type; 53 }; 54 55 template<BOOST_PP_ENUM_PARAMS(N, typename A)> 56 typename result< 57 Derived const( 58 BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT) 59 ) 60 >::type operator ()(BOOST_PP_ENUM_BINARY_PARAMS (N,A,const & a)) const61 operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const 62 { 63 result< 64 Derived const( 65 BOOST_PP_ENUM_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT) 66 ) 67 > impl; 68 69 return impl(BOOST_PP_ENUM(N, BOOST_PROTO_NORMALIZE_ARG, ~)); 70 } 71 72 #undef N 73 74 #endif // BOOST_PROTO_DONT_USE_PREPROCESSED_FILES 75