2 #if !defined(BOOST_PP_IS_ITERATING)
\r
6 #ifndef BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
\r
7 #define BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
\r
9 // Copyright Aleksey Gurtovoy 2002-2004
\r
11 // Distributed under the Boost Software License, Version 1.0.
\r
12 // (See accompanying file LICENSE_1_0.txt or copy at
\r
13 // http://www.boost.org/LICENSE_1_0.txt)
\r
15 // See http://www.boost.org/libs/mpl for documentation.
\r
17 // $Id: unpack_args.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
\r
18 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
\r
19 // $Revision: 49267 $
\r
21 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
\r
22 # include <boost/mpl/apply.hpp>
\r
23 # include <boost/mpl/at.hpp>
\r
24 # include <boost/mpl/size.hpp>
\r
25 # include <boost/mpl/aux_/nttp_decl.hpp>
\r
26 # include <boost/mpl/aux_/lambda_spec.hpp>
\r
29 #include <boost/mpl/aux_/config/use_preprocessed.hpp>
\r
31 #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
\r
32 && !defined(BOOST_MPL_PREPROCESSING_MODE)
\r
34 # define BOOST_MPL_PREPROCESSED_HEADER unpack_args.hpp
\r
35 # include <boost/mpl/aux_/include_preprocessed.hpp>
\r
39 # include <boost/mpl/limits/arity.hpp>
\r
40 # include <boost/mpl/aux_/preprocessor/repeat.hpp>
\r
41 # include <boost/mpl/aux_/config/ctps.hpp>
\r
42 # include <boost/mpl/aux_/config/forwarding.hpp>
\r
43 # include <boost/preprocessor/iterate.hpp>
\r
44 # include <boost/preprocessor/cat.hpp>
\r
47 namespace boost { namespace mpl {
\r
49 // local macros, #undef-ined at the end of the header
\r
51 # define AUX778076_UNPACK(unused, i, Args) \
\r
52 , typename at_c<Args,i>::type \
\r
55 # define AUX778076_UNPACKED_ARGS(n, Args) \
\r
56 BOOST_MPL_PP_REPEAT(n, AUX778076_UNPACK, Args) \
\r
61 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
62 template< int size, typename F, typename Args >
\r
63 struct unpack_args_impl;
\r
65 template< BOOST_MPL_AUX_NTTP_DECL(int, size) > struct unpack_args_impl
\r
67 template< typename F, typename Args > struct apply;
\r
71 #define BOOST_PP_ITERATION_PARAMS_1 \
\r
72 (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/unpack_args.hpp>))
\r
73 #include BOOST_PP_ITERATE()
\r
82 template< typename Args > struct apply
\r
83 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
\r
84 # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
85 : aux::unpack_args_impl< size<Args>::value,F,Args >
\r
87 : aux::unpack_args_impl< size<Args>::value >
\r
88 ::template apply< F,Args >
\r
91 #else // BOOST_MPL_CFG_NO_NESTED_FORWARDING
\r
93 typedef typename aux::unpack_args_impl<
\r
102 BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1, unpack_args)
\r
104 # undef AUX778076_UNPACK
\r
105 # undef AUX778076_UNPACKED_ARGS
\r
109 #endif // BOOST_MPL_CFG_USE_PREPROCESSED_HEADERS
\r
110 #endif // BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
\r
112 ///// iteration, depth == 1
\r
114 // For gcc 4.4 compatability, we must include the
\r
115 // BOOST_PP_ITERATION_DEPTH test inside an #else clause.
\r
116 #else // BOOST_PP_IS_ITERATING
\r
117 #if BOOST_PP_ITERATION_DEPTH() == 1
\r
119 # define i_ BOOST_PP_FRAME_ITERATION(1)
\r
121 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
123 template< typename F, typename Args >
\r
124 struct unpack_args_impl<i_,F,Args>
\r
125 : BOOST_PP_CAT(apply,i_)<
\r
127 AUX778076_UNPACKED_ARGS(i_, Args)
\r
134 template<> struct unpack_args_impl<i_>
\r
136 template< typename F, typename Args > struct apply
\r
137 : BOOST_PP_CAT(apply,i_)<
\r
139 AUX778076_UNPACKED_ARGS(i_, Args)
\r
149 #endif // BOOST_PP_ITERATION_DEPTH()
\r
150 #endif // BOOST_PP_IS_ITERATING
\r