1 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) 2 3 #include <boost/proto/transform/detail/preprocessed/expand_pack.hpp> 4 5 #elif !defined(BOOST_PP_IS_ITERATING) 6 7 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) 8 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/expand_pack.hpp") 9 #endif 10 11 /////////////////////////////////////////////////////////////////////////////// 12 /// \file expand_pack.hpp 13 /// Contains helpers for pseudo-pack expansion. 14 // 15 // Copyright 2012 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) 18 19 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) 20 #pragma wave option(preserve: 1) 21 #endif 22 23 #define BOOST_PP_ITERATION_PARAMS_1 \ 24 (3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/expand_pack.hpp>)) 25 #include BOOST_PP_ITERATE() 26 27 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) 28 #pragma wave option(output: null) 29 #endif 30 31 #else 32 #define N BOOST_PP_ITERATION() 33 #define M0(Z, X, DATA) typename expand_pattern_helper<Tfx, BOOST_PP_CAT(A, X)>::type 34 #define M1(Z, X, DATA) expand_pattern_helper<Tfx, BOOST_PP_CAT(A, X)>::applied::value || 35 36 template<typename Tfx, typename Ret BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)> 37 struct expand_pattern_helper<Tfx, Ret(BOOST_PP_ENUM_PARAMS(N, A))> 38 { 39 typedef Ret (*type)(BOOST_PP_ENUM(N, M0, ~)); 40 typedef mpl::bool_<BOOST_PP_REPEAT(N, M1, ~) false> applied; 41 }; 42 43 #undef M1 44 #undef M0 45 #undef N 46 #endif 47