Update contrib.
1 #if !defined(BOOST_PP_IS_ITERATING)
3 // Copyright David Abrahams 2002.
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 # ifndef SIGNATURE_DWA20021121_HPP
9 # define SIGNATURE_DWA20021121_HPP
11 # include <boost/python/type_id.hpp>
13 # include <boost/python/detail/preprocessor.hpp>
14 # include <boost/python/detail/indirect_traits.hpp>
16 # include <boost/preprocessor/iterate.hpp>
17 # include <boost/preprocessor/iteration/local.hpp>
19 # include <boost/mpl/at.hpp>
20 # include <boost/mpl/size.hpp>
22 namespace boost { namespace python { namespace detail {
24 struct signature_element
30 template <unsigned> struct signature_arity;
32 # define BOOST_PP_ITERATION_PARAMS_1 \
33 (3, (0, BOOST_PYTHON_MAX_ARITY + 1, <boost/python/detail/signature.hpp>))
34 # include BOOST_PP_ITERATE()
36 // A metafunction returning the base class used for
38 // signature<class F, class CallPolicies, class Sig>.
41 struct signature_base_select
43 enum { arity = mpl::size<Sig>::value - 1 };
44 typedef typename signature_arity<arity>::template impl<Sig> type;
49 : signature_base_select<Sig>::type
53 }}} // namespace boost::python::detail
55 # endif // SIGNATURE_DWA20021121_HPP
59 # define N BOOST_PP_ITERATION()
62 struct signature_arity<N>
67 static signature_element const* elements()
69 static signature_element const result[N+2] = {
71 # define BOOST_PP_LOCAL_MACRO(i) \
73 type_id<BOOST_DEDUCED_TYPENAME mpl::at_c<Sig,i>::type>().name() \
74 , indirect_traits::is_reference_to_non_const<BOOST_DEDUCED_TYPENAME mpl::at_c<Sig,i>::type>::value \
77 # define BOOST_PP_LOCAL_LIMITS (0, N)
78 # include BOOST_PP_LOCAL_ITERATE()
86 #endif // BOOST_PP_IS_ITERATING