#pragma once #ifndef PACK_ARGS_LIMIT #define PACK_ARGS_LIMIT 10 #endif #include #include #include #include #include #include #include #include #include #include namespace detail_ { template struct pack_args_forward { }; template struct pack_args_forwardconst { }; #define PP_AT_C(z, n, text) typename boost::fusion::result_of::at_c::type BOOST_PP_CAT(text, n) #define PP_PACK_ARGS_N(z, n, text) \ template \ struct BOOST_PP_CAT(pack_args_forward, text) \ { \ Result operator() (BOOST_PP_ENUM(n, PP_AT_C, a) ) text \ { \ return (*(static_cast(this))).on_packed_args(Sequence(BOOST_PP_ENUM_PARAMS(n, a))); \ } \ }; BOOST_PP_REPEAT(PACK_ARGS_LIMIT, PP_PACK_ARGS_N, BOOST_PP_EMPTY()) BOOST_PP_REPEAT(PACK_ARGS_LIMIT, PP_PACK_ARGS_N, const) #undef PP_PACK_ARGS_N #undef PP_AT_C struct pack_args_n { template struct pack_args : public pack_args_forward::value> { }; }; struct pack_args_n_const { template struct pack_args : public pack_args_forwardconst::value> { }; }; } // namespace detail template struct pack_args : public boost::mpl::if_c < boost::is_const::value, detail_::pack_args_n_const, detail_::pack_args_n >::type::pack_args { typedef Result result_type; typedef Sequence sequence_type; };