First public contribution.
2 #if !defined(BOOST_PP_IS_ITERATING)
6 #ifndef BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
7 #define BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
9 // Copyright Aleksey Gurtovoy 2002-2004
11 // Distributed under the Boost Software License, Version 1.0.
12 // (See accompanying file LICENSE_1_0.txt or copy at
13 // http://www.boost.org/LICENSE_1_0.txt)
15 // See http://www.boost.org/libs/mpl for documentation.
17 // $Source: /cvsroot/boost/boost/boost/mpl/unpack_args.hpp,v $
18 // $Date: 2004/09/02 15:40:42 $
21 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
22 # include <boost/mpl/apply.hpp>
23 # include <boost/mpl/at.hpp>
24 # include <boost/mpl/size.hpp>
25 # include <boost/mpl/aux_/nttp_decl.hpp>
26 # include <boost/mpl/aux_/lambda_spec.hpp>
29 #include <boost/mpl/aux_/config/use_preprocessed.hpp>
31 #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
32 && !defined(BOOST_MPL_PREPROCESSING_MODE)
34 # define BOOST_MPL_PREPROCESSED_HEADER unpack_args.hpp
35 # include <boost/mpl/aux_/include_preprocessed.hpp>
39 # include <boost/mpl/limits/arity.hpp>
40 # include <boost/mpl/aux_/preprocessor/repeat.hpp>
41 # include <boost/mpl/aux_/config/ctps.hpp>
42 # include <boost/mpl/aux_/config/forwarding.hpp>
43 # include <boost/preprocessor/iterate.hpp>
44 # include <boost/preprocessor/cat.hpp>
47 namespace boost { namespace mpl {
49 // local macros, #undef-ined at the end of the header
51 # define AUX778076_UNPACK(unused, i, Args) \
52 , typename at_c<Args,i>::type \
55 # define AUX778076_UNPACKED_ARGS(n, Args) \
56 BOOST_MPL_PP_REPEAT(n, AUX778076_UNPACK, Args) \
61 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
62 template< int size, typename F, typename Args >
63 struct unpack_args_impl;
65 template< BOOST_MPL_AUX_NTTP_DECL(int, size) > struct unpack_args_impl
67 template< typename F, typename Args > struct apply;
71 #define BOOST_PP_ITERATION_PARAMS_1 \
72 (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/unpack_args.hpp>))
73 #include BOOST_PP_ITERATE()
82 template< typename Args > struct apply
83 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
84 # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
85 : aux::unpack_args_impl< size<Args>::value,F,Args >
87 : aux::unpack_args_impl< size<Args>::value >
88 ::template apply< F,Args >
91 #else // BOOST_MPL_CFG_NO_NESTED_FORWARDING
93 typedef typename aux::unpack_args_impl<
102 BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1, unpack_args)
104 # undef AUX778076_UNPACK
105 # undef AUX778076_UNPACKED_ARGS
109 #endif // BOOST_MPL_CFG_USE_PREPROCESSED_HEADERS
110 #endif // BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
112 ///// iteration, depth == 1
114 #elif BOOST_PP_ITERATION_DEPTH() == 1
116 # define i_ BOOST_PP_FRAME_ITERATION(1)
118 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
120 template< typename F, typename Args >
121 struct unpack_args_impl<i_,F,Args>
122 : BOOST_PP_CAT(apply,i_)<
124 AUX778076_UNPACKED_ARGS(i_, Args)
131 template<> struct unpack_args_impl<i_>
133 template< typename F, typename Args > struct apply
134 : BOOST_PP_CAT(apply,i_)<
136 AUX778076_UNPACKED_ARGS(i_, Args)
146 #endif // BOOST_PP_IS_ITERATING