1 #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
3 #include <boost/proto/transform/detail/preprocessed/pack_impl.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/pack_impl.hpp")
11 ///////////////////////////////////////////////////////////////////////////////
12 /// \file pack_impl.hpp
13 /// Contains helpers for pseudo-pack expansion.
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)
19 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
20 #pragma wave option(preserve: 1)
23 #define BOOST_PP_ITERATION_PARAMS_1 \
24 (3, (0, BOOST_PP_DEC(BOOST_PROTO_MAX_ARITY), <boost/proto/transform/detail/pack_impl.hpp>))
25 #include BOOST_PP_ITERATE()
27 #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
28 #pragma wave option(output: null)
32 #if BOOST_PP_ITERATION_DEPTH() == 1
33 #define N BOOST_PP_ITERATION()
34 #define M BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N)
35 #define M0(Z, X, D) typename expand_pattern_helper<proto::_child_c<X>, Fun>::type
37 template<typename Fun, typename Cont>
38 struct expand_pattern<BOOST_PP_INC(N), Fun, Cont>
39 : Cont::template cat<BOOST_PP_ENUM(BOOST_PP_INC(N), M0, ~)>
42 (expand_pattern_helper<proto::_child_c<0>, Fun>::applied::value)
43 , NO_PACK_EXPRESSION_FOUND_IN_UNPACKING_PATTERN
48 template<typename Ret BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
49 struct BOOST_PP_CAT(expand_pattern_rest_, N)
51 template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PP_INC(M), typename C, void)>
54 #define BOOST_PP_ITERATION_PARAMS_2 \
55 (3, (1, M, <boost/proto/transform/detail/pack_impl.hpp>))
56 #include BOOST_PP_ITERATE()
62 #define I BOOST_PP_ITERATION()
63 #define J BOOST_PP_RELATIVE_ITERATION(1)
64 template<BOOST_PP_ENUM_PARAMS(I, typename C)>
65 struct cat<BOOST_PP_ENUM_PARAMS(I, C)>
67 typedef msvc_fun_workaround<Ret(BOOST_PP_ENUM_PARAMS(J, A) BOOST_PP_COMMA_IF(J) BOOST_PP_ENUM_PARAMS(I, C))> type;