Chris@16: Chris@16: #if !defined(BOOST_PP_IS_ITERATING) Chris@16: Chris@16: ///// header body Chris@16: Chris@16: #ifndef BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED Chris@16: #define BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED Chris@16: Chris@16: // Copyright Aleksey Gurtovoy 2002-2004 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/mpl for documentation. Chris@16: Chris@101: // $Id$ Chris@101: // $Date$ Chris@101: // $Revision$ Chris@16: Chris@16: #if !defined(BOOST_MPL_PREPROCESSING_MODE) Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: #endif Chris@16: Chris@16: #include Chris@16: Chris@16: #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ Chris@16: && !defined(BOOST_MPL_PREPROCESSING_MODE) Chris@16: Chris@16: # define BOOST_MPL_PREPROCESSED_HEADER unpack_args.hpp Chris@16: # include Chris@16: Chris@16: #else Chris@16: Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: Chris@16: // local macros, #undef-ined at the end of the header Chris@16: Chris@16: # define AUX778076_UNPACK(unused, i, Args) \ Chris@16: , typename at_c::type \ Chris@16: /**/ Chris@16: Chris@16: # define AUX778076_UNPACKED_ARGS(n, Args) \ Chris@16: BOOST_MPL_PP_REPEAT(n, AUX778076_UNPACK, Args) \ Chris@16: /**/ Chris@16: Chris@16: namespace aux { Chris@16: Chris@16: #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: template< int size, typename F, typename Args > Chris@16: struct unpack_args_impl; Chris@16: #else Chris@16: template< BOOST_MPL_AUX_NTTP_DECL(int, size) > struct unpack_args_impl Chris@16: { Chris@16: template< typename F, typename Args > struct apply; Chris@16: }; Chris@16: #endif Chris@16: Chris@16: #define BOOST_PP_ITERATION_PARAMS_1 \ Chris@16: (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, )) Chris@16: #include BOOST_PP_ITERATE() Chris@16: Chris@16: } Chris@16: Chris@16: template< Chris@16: typename F Chris@16: > Chris@16: struct unpack_args Chris@16: { Chris@16: template< typename Args > struct apply Chris@16: #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING) Chris@16: # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: : aux::unpack_args_impl< size::value,F,Args > Chris@16: # else Chris@16: : aux::unpack_args_impl< size::value > Chris@16: ::template apply< F,Args > Chris@16: # endif Chris@16: { Chris@16: #else // BOOST_MPL_CFG_NO_NESTED_FORWARDING Chris@16: { Chris@16: typedef typename aux::unpack_args_impl< Chris@16: size::value Chris@16: , F Chris@16: , Args Chris@16: >::type type; Chris@16: #endif Chris@16: }; Chris@16: }; Chris@16: Chris@16: BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1, unpack_args) Chris@16: Chris@16: # undef AUX778076_UNPACK Chris@16: # undef AUX778076_UNPACKED_ARGS Chris@16: Chris@16: }} Chris@16: Chris@16: #endif // BOOST_MPL_CFG_USE_PREPROCESSED_HEADERS Chris@16: #endif // BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED Chris@16: Chris@16: ///// iteration, depth == 1 Chris@16: Chris@16: // For gcc 4.4 compatability, we must include the Chris@16: // BOOST_PP_ITERATION_DEPTH test inside an #else clause. Chris@16: #else // BOOST_PP_IS_ITERATING Chris@16: #if BOOST_PP_ITERATION_DEPTH() == 1 Chris@16: Chris@16: # define i_ BOOST_PP_FRAME_ITERATION(1) Chris@16: Chris@16: #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) Chris@16: Chris@16: template< typename F, typename Args > Chris@16: struct unpack_args_impl Chris@16: : BOOST_PP_CAT(apply,i_)< Chris@16: F Chris@16: AUX778076_UNPACKED_ARGS(i_, Args) Chris@16: > Chris@16: { Chris@16: }; Chris@16: Chris@16: #else Chris@16: Chris@16: template<> struct unpack_args_impl Chris@16: { Chris@16: template< typename F, typename Args > struct apply Chris@16: : BOOST_PP_CAT(apply,i_)< Chris@16: F Chris@16: AUX778076_UNPACKED_ARGS(i_, Args) Chris@16: > Chris@16: { Chris@16: }; Chris@16: }; Chris@16: Chris@16: #endif Chris@16: Chris@16: # undef i_ Chris@16: Chris@16: #endif // BOOST_PP_ITERATION_DEPTH() Chris@16: #endif // BOOST_PP_IS_ITERATING