1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/python/detail/target.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,82 @@
1.4 +#if !defined(BOOST_PP_IS_ITERATING)
1.5 +
1.6 +// Copyright David Abrahams 2002.
1.7 +// Distributed under the Boost Software License, Version 1.0. (See
1.8 +// accompanying file LICENSE_1_0.txt or copy at
1.9 +// http://www.boost.org/LICENSE_1_0.txt)
1.10 +
1.11 +# ifndef TARGET_DWA2002521_HPP
1.12 +# define TARGET_DWA2002521_HPP
1.13 +
1.14 +# include <boost/python/detail/preprocessor.hpp>
1.15 +
1.16 +# include <boost/type.hpp>
1.17 +
1.18 +# include <boost/preprocessor/comma_if.hpp>
1.19 +# include <boost/preprocessor/if.hpp>
1.20 +# include <boost/preprocessor/iterate.hpp>
1.21 +# include <boost/preprocessor/debug/line.hpp>
1.22 +# include <boost/preprocessor/enum_params.hpp>
1.23 +# include <boost/preprocessor/repetition/enum_trailing_params.hpp>
1.24 +
1.25 +namespace boost { namespace python { namespace detail {
1.26 +
1.27 +# define BOOST_PP_ITERATION_PARAMS_1 \
1.28 + (4, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/target.hpp>, BOOST_PYTHON_FUNCTION_POINTER))
1.29 +# include BOOST_PP_ITERATE()
1.30 +
1.31 +# define BOOST_PP_ITERATION_PARAMS_1 \
1.32 + (4, (0, BOOST_PYTHON_CV_COUNT - 1, <boost/python/detail/target.hpp>, BOOST_PYTHON_POINTER_TO_MEMBER))
1.33 +# include BOOST_PP_ITERATE()
1.34 +
1.35 +template <class R, class T>
1.36 +T& (* target(R (T::*)) )() { return 0; }
1.37 +
1.38 +}}} // namespace boost::python::detail
1.39 +
1.40 +# endif // TARGET_DWA2002521_HPP
1.41 +
1.42 +/* --------------- function pointers --------------- */
1.43 +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER
1.44 +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \
1.45 + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
1.46 +# line BOOST_PP_LINE(__LINE__, target.hpp(function_pointers))
1.47 +# endif
1.48 +
1.49 +# define N BOOST_PP_ITERATION()
1.50 +
1.51 +template <class R BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)>
1.52 +BOOST_PP_IF(N, A0, void)(* target(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A))) )()
1.53 +{
1.54 + return 0;
1.55 +}
1.56 +
1.57 +# undef N
1.58 +
1.59 +/* --------------- pointers-to-members --------------- */
1.60 +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_POINTER_TO_MEMBER
1.61 +// Outer over cv-qualifiers
1.62 +
1.63 +# define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/target.hpp>))
1.64 +# include BOOST_PP_ITERATE()
1.65 +
1.66 +#elif BOOST_PP_ITERATION_DEPTH() == 2
1.67 +# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \
1.68 + && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
1.69 +# line BOOST_PP_LINE(__LINE__, target.hpp(pointers-to-members))
1.70 +# endif
1.71 +// Inner over arities
1.72 +
1.73 +# define N BOOST_PP_ITERATION()
1.74 +# define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1))
1.75 +
1.76 +template <class R, class T BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)>
1.77 +T& (* target(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q) )()
1.78 +{
1.79 + return 0;
1.80 +}
1.81 +
1.82 +# undef N
1.83 +# undef Q
1.84 +
1.85 +#endif