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 TARGET_DWA2002521_HPP
9 # define TARGET_DWA2002521_HPP
11 # include <boost/python/detail/preprocessor.hpp>
13 # include <boost/type.hpp>
15 # include <boost/preprocessor/comma_if.hpp>
16 # include <boost/preprocessor/if.hpp>
17 # include <boost/preprocessor/iterate.hpp>
18 # include <boost/preprocessor/debug/line.hpp>
19 # include <boost/preprocessor/enum_params.hpp>
20 # include <boost/preprocessor/repetition/enum_trailing_params.hpp>
22 namespace boost { namespace python { namespace detail {
24 # define BOOST_PP_ITERATION_PARAMS_1 \
25 (4, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/target.hpp>, BOOST_PYTHON_FUNCTION_POINTER))
26 # include BOOST_PP_ITERATE()
28 # define BOOST_PP_ITERATION_PARAMS_1 \
29 (4, (0, BOOST_PYTHON_CV_COUNT - 1, <boost/python/detail/target.hpp>, BOOST_PYTHON_POINTER_TO_MEMBER))
30 # include BOOST_PP_ITERATE()
32 template <class R, class T>
33 T& (* target(R (T::*)) )() { return 0; }
35 }}} // namespace boost::python::detail
37 # endif // TARGET_DWA2002521_HPP
39 /* --------------- function pointers --------------- */
40 #elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER
41 # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \
42 && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
43 # line BOOST_PP_LINE(__LINE__, target.hpp(function_pointers))
46 # define N BOOST_PP_ITERATION()
48 template <class R BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)>
49 BOOST_PP_IF(N, A0, void)(* target(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A))) )()
56 /* --------------- pointers-to-members --------------- */
57 #elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_POINTER_TO_MEMBER
58 // Outer over cv-qualifiers
60 # define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/target.hpp>))
61 # include BOOST_PP_ITERATE()
63 #elif BOOST_PP_ITERATION_DEPTH() == 2
64 # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \
65 && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
66 # line BOOST_PP_LINE(__LINE__, target.hpp(pointers-to-members))
70 # define N BOOST_PP_ITERATION()
71 # define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1))
73 template <class R, class T BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)>
74 T& (* target(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q) )()