os/ossrv/ossrv_pub/boost_apis/boost/python/detail/target.hpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
#if !defined(BOOST_PP_IS_ITERATING)
sl@0
     2
sl@0
     3
// Copyright David Abrahams 2002.
sl@0
     4
// Distributed under the Boost Software License, Version 1.0. (See
sl@0
     5
// accompanying file LICENSE_1_0.txt or copy at
sl@0
     6
// http://www.boost.org/LICENSE_1_0.txt)
sl@0
     7
sl@0
     8
# ifndef TARGET_DWA2002521_HPP
sl@0
     9
#  define TARGET_DWA2002521_HPP
sl@0
    10
sl@0
    11
#  include <boost/python/detail/preprocessor.hpp>
sl@0
    12
sl@0
    13
#  include <boost/type.hpp>
sl@0
    14
sl@0
    15
#  include <boost/preprocessor/comma_if.hpp>
sl@0
    16
#  include <boost/preprocessor/if.hpp>
sl@0
    17
#  include <boost/preprocessor/iterate.hpp>
sl@0
    18
#  include <boost/preprocessor/debug/line.hpp>
sl@0
    19
#  include <boost/preprocessor/enum_params.hpp>
sl@0
    20
#  include <boost/preprocessor/repetition/enum_trailing_params.hpp>
sl@0
    21
sl@0
    22
namespace boost { namespace python { namespace detail {
sl@0
    23
sl@0
    24
#  define BOOST_PP_ITERATION_PARAMS_1                                                                   \
sl@0
    25
    (4, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/target.hpp>, BOOST_PYTHON_FUNCTION_POINTER))
sl@0
    26
#  include BOOST_PP_ITERATE()
sl@0
    27
sl@0
    28
#  define BOOST_PP_ITERATION_PARAMS_1                                                                    \
sl@0
    29
    (4, (0, BOOST_PYTHON_CV_COUNT - 1, <boost/python/detail/target.hpp>, BOOST_PYTHON_POINTER_TO_MEMBER))
sl@0
    30
#  include BOOST_PP_ITERATE()
sl@0
    31
sl@0
    32
template <class R, class T>
sl@0
    33
T& (* target(R (T::*)) )() { return 0; }
sl@0
    34
sl@0
    35
}}} // namespace boost::python::detail
sl@0
    36
sl@0
    37
# endif // TARGET_DWA2002521_HPP
sl@0
    38
sl@0
    39
/* --------------- function pointers --------------- */
sl@0
    40
#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER
sl@0
    41
# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100)                      \
sl@0
    42
        && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
sl@0
    43
#  line BOOST_PP_LINE(__LINE__, target.hpp(function_pointers))
sl@0
    44
# endif 
sl@0
    45
sl@0
    46
# define N BOOST_PP_ITERATION()
sl@0
    47
sl@0
    48
template <class R BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)>
sl@0
    49
BOOST_PP_IF(N, A0, void)(* target(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A))) )()
sl@0
    50
{
sl@0
    51
    return 0;
sl@0
    52
}
sl@0
    53
sl@0
    54
# undef N
sl@0
    55
sl@0
    56
/* --------------- pointers-to-members --------------- */
sl@0
    57
#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_POINTER_TO_MEMBER
sl@0
    58
// Outer over cv-qualifiers
sl@0
    59
sl@0
    60
# define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/target.hpp>))
sl@0
    61
# include BOOST_PP_ITERATE()
sl@0
    62
sl@0
    63
#elif BOOST_PP_ITERATION_DEPTH() == 2
sl@0
    64
# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100)                      \
sl@0
    65
        && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
sl@0
    66
#  line BOOST_PP_LINE(__LINE__, target.hpp(pointers-to-members))
sl@0
    67
# endif 
sl@0
    68
// Inner over arities
sl@0
    69
sl@0
    70
# define N BOOST_PP_ITERATION()
sl@0
    71
# define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1))
sl@0
    72
sl@0
    73
template <class R, class T BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)>
sl@0
    74
T& (* target(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q) )()
sl@0
    75
{
sl@0
    76
    return 0;
sl@0
    77
}
sl@0
    78
sl@0
    79
# undef N
sl@0
    80
# undef Q
sl@0
    81
sl@0
    82
#endif