// Copyright Daniel Wallin 2008. Use, modification and distribution is // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if !BOOST_PP_IS_ITERATING # ifndef LUABIND_DEDUCE_SIGNATURE_080911_HPP # define LUABIND_DEDUCE_SIGNATURE_080911_HPP # include # if LUABIND_MAX_ARITY <= 8 # include # else # include # endif # include # include # include namespace luabind { namespace detail { namespace mpl = boost::mpl; template mpl::vector1 deduce_signature(R(*)(), ...) { return mpl::vector1(); } template mpl::vector2 deduce_signature(R(T::*)()) { return mpl::vector2(); } template mpl::vector2::type&> deduce_signature(R(T::*)(), Wrapped*) { return mpl::vector2::type&>(); } template mpl::vector2 deduce_signature(R(T::*)() const) { return mpl::vector2(); } template mpl::vector2::type const&> deduce_signature(R(T::*)() const, Wrapped*) { return mpl::vector2::type const&>(); } # define BOOST_PP_ITERATION_PARAMS_1 \ (3, (1, LUABIND_MAX_ARITY, )) # include BOOST_PP_ITERATE() }} // namespace luabind::detail # endif // LUABIND_DEDUCE_SIGNATURE_080911_HPP #else // BOOST_PP_IS_ITERATING # define N BOOST_PP_ITERATION() # define NPLUS1 BOOST_PP_INC(N) template BOOST_PP_CAT(mpl::vector,NPLUS1) deduce_signature(R(*)(BOOST_PP_ENUM_PARAMS(N,A)), ...) { return BOOST_PP_CAT(mpl::vector,NPLUS1)(); } # define NPLUS2 BOOST_PP_INC(NPLUS1) template BOOST_PP_CAT(mpl::vector,NPLUS2) deduce_signature(R(T::*)(BOOST_PP_ENUM_PARAMS(N,A))) { return BOOST_PP_CAT(mpl::vector,NPLUS2)(); } template BOOST_PP_CAT(mpl::vector,NPLUS2)< R, typename most_derived::type&, BOOST_PP_ENUM_PARAMS(N,A) > deduce_signature(R(T::*)(BOOST_PP_ENUM_PARAMS(N,A)), Wrapped*) { return BOOST_PP_CAT(mpl::vector,NPLUS2)< R,typename most_derived::type&,BOOST_PP_ENUM_PARAMS(N,A)>(); } template BOOST_PP_CAT(mpl::vector,NPLUS2) deduce_signature(R(T::*)(BOOST_PP_ENUM_PARAMS(N,A)) const) { return BOOST_PP_CAT(mpl::vector,NPLUS2)(); } template BOOST_PP_CAT(mpl::vector,NPLUS2)< R, typename most_derived::type const&, BOOST_PP_ENUM_PARAMS(N,A) > deduce_signature(R(T::*)(BOOST_PP_ENUM_PARAMS(N,A)) const, Wrapped*) { return BOOST_PP_CAT(mpl::vector,NPLUS2)< R,typename most_derived::type const&,BOOST_PP_ENUM_PARAMS(N,A)>(); } # undef NPLUS2 # undef NPLUS1 # undef N #endif // BOOST_PP_IS_ITERATING