File indexing completed on 2025-01-18 09:50:38
0001 #if !defined(BOOST_PP_IS_ITERATING)
0002
0003
0004
0005
0006
0007
0008 # ifndef RESULT_DWA2002521_HPP
0009 # define RESULT_DWA2002521_HPP
0010
0011 # include <boost/type.hpp>
0012
0013 # include <boost/python/detail/preprocessor.hpp>
0014 # include <boost/python/detail/type_traits.hpp>
0015
0016 # include <boost/mpl/if.hpp>
0017
0018 # include <boost/preprocessor/comma_if.hpp>
0019 # include <boost/preprocessor/iterate.hpp>
0020 # include <boost/preprocessor/debug/line.hpp>
0021 # include <boost/preprocessor/enum_params.hpp>
0022 # include <boost/preprocessor/repetition/enum_trailing_params.hpp>
0023
0024 namespace boost { namespace python { namespace detail {
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 # define BOOST_PP_ITERATION_PARAMS_1 \
0036 (4, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/result.hpp>, BOOST_PYTHON_FUNCTION_POINTER))
0037 # include BOOST_PP_ITERATE()
0038
0039 # define BOOST_PP_ITERATION_PARAMS_1 \
0040 (4, (0, BOOST_PYTHON_CV_COUNT - 1, <boost/python/detail/result.hpp>, BOOST_PYTHON_POINTER_TO_MEMBER))
0041 # include BOOST_PP_ITERATE()
0042
0043 template <class R, class T>
0044 boost::type<R>* result(R (T::*), int = 0) { return 0; }
0045
0046 # if (defined(__MWERKS__) && __MWERKS__ < 0x3000)
0047
0048 template <class T>
0049 struct get_result_type
0050 {
0051 typedef boost::type<typename T::result_type> type;
0052 };
0053
0054 struct void_type
0055 {
0056 typedef void type;
0057 };
0058
0059 template <class T>
0060 struct result_result
0061 {
0062 typedef typename mpl::if_c<
0063 is_class<T>::value
0064 , get_result_type<T>
0065 , void_type
0066 >::type t1;
0067
0068 typedef typename t1::type* type;
0069 };
0070
0071 template <class X>
0072 typename result_result<X>::type
0073 result(X const&, short) { return 0; }
0074
0075 # else
0076 template <class X>
0077 boost::type<typename X::result_type>*
0078 result(X const&, short = 0) { return 0; }
0079
0080 # endif
0081
0082 }}}
0083
0084 # endif
0085
0086
0087
0088
0089 #else
0090 #if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER
0091 # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \
0092 && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
0093 # line BOOST_PP_LINE(__LINE__, result.hpp(function pointers))
0094 # endif
0095
0096 # define N BOOST_PP_ITERATION()
0097
0098 template <class R BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)>
0099 boost::type<R>* result(R (*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)), int = 0)
0100 {
0101 return 0;
0102 }
0103
0104 # undef N
0105
0106
0107 #elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_POINTER_TO_MEMBER
0108
0109
0110 # define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/result.hpp>))
0111 # include BOOST_PP_ITERATE()
0112
0113 #elif BOOST_PP_ITERATION_DEPTH() == 2
0114 # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \
0115 && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
0116 # line BOOST_PP_LINE(__LINE__, result.hpp(pointers-to-members))
0117 # endif
0118
0119
0120 # define N BOOST_PP_ITERATION()
0121 # define Q BOOST_PYTHON_CV_QUALIFIER(BOOST_PP_RELATIVE_ITERATION(1))
0122
0123 template <class R, class T BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)>
0124 boost::type<R>* result(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q, int = 0)
0125 {
0126 return 0;
0127 }
0128
0129 # undef N
0130 # undef Q
0131
0132 #endif
0133 #endif