mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 06:02:14 +00:00
Changes for MPL v2
[SVN r13504]
This commit is contained in:
@@ -14,8 +14,9 @@
|
||||
# include <boost/config.hpp>
|
||||
# include <boost/python/detail/char_array.hpp>
|
||||
# include <boost/python/detail/preprocessor.hpp>
|
||||
# include <boost/mpl/aux_/preprocessor.hpp>
|
||||
# include <boost/preprocessor/comma_if.hpp>
|
||||
# include <boost/preprocessor/enum_params.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
|
||||
namespace boost { namespace python { namespace detail {
|
||||
|
||||
@@ -33,18 +34,18 @@ template <class F> struct arg_tuple_size;
|
||||
|
||||
// Specializations for function pointers
|
||||
# define BOOST_PYTHON_ARG_TUPLE_SIZE_PF(args, ignored) \
|
||||
template <class R BOOST_PP_COMMA_IF(args) BOOST_MPL_TEMPLATE_PARAMETERS(0, args, class A)> \
|
||||
template <class R BOOST_PP_COMMA_IF(args) BOOST_PP_ENUM_PARAMS(args, class A)> \
|
||||
struct arg_tuple_size<BOOST_PYTHON_FN(*,0,args)> \
|
||||
{ \
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = args); \
|
||||
};
|
||||
|
||||
// Specializations for member function pointers
|
||||
# define BOOST_PYTHON_ARG_TUPLE_SIZE_PMF(args, cv) \
|
||||
template <class R, BOOST_MPL_TEMPLATE_PARAMETERS(0, args, class A)> \
|
||||
struct arg_tuple_size<BOOST_PYTHON_FN(A0::*,1,args) cv()> \
|
||||
{ \
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = args); \
|
||||
# define BOOST_PYTHON_ARG_TUPLE_SIZE_PMF(args, cv) \
|
||||
template <class R, BOOST_PP_ENUM_PARAMS(args, class A)> \
|
||||
struct arg_tuple_size<BOOST_PYTHON_FN(A0::*,1,args) cv()> \
|
||||
{ \
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value = args); \
|
||||
};
|
||||
|
||||
# else
|
||||
@@ -60,12 +61,12 @@ struct arg_tuple_size<BOOST_PYTHON_FN(A0::*,1,args) cv()> \
|
||||
// their return value is used to discriminate between various free
|
||||
// and member function pointers at compile-time.
|
||||
|
||||
# define BOOST_PYTHON_ARG_TUPLE_SIZE_PF(args, ignored) \
|
||||
template <class R BOOST_PP_COMMA_IF(args) BOOST_MPL_TEMPLATE_PARAMETERS(0, args, class A)> \
|
||||
# define BOOST_PYTHON_ARG_TUPLE_SIZE_PF(args, ignored) \
|
||||
template <class R BOOST_PP_COMMA_IF(args) BOOST_PP_ENUM_PARAMS(args, class A)> \
|
||||
char_array<args> arg_tuple_size_helper(BOOST_PYTHON_FN(*,0,args));
|
||||
|
||||
# define BOOST_PYTHON_ARG_TUPLE_SIZE_PMF(args, cv) \
|
||||
template <class R, BOOST_MPL_TEMPLATE_PARAMETERS(0, args, class A)> \
|
||||
# define BOOST_PYTHON_ARG_TUPLE_SIZE_PMF(args, cv) \
|
||||
template <class R, BOOST_PP_ENUM_PARAMS(args, class A)> \
|
||||
char_array<args> arg_tuple_size_helper(BOOST_PYTHON_FN(A0::*,1,args)cv());
|
||||
|
||||
# endif
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
# include <boost/python/detail/wrap_python.hpp>
|
||||
# include <boost/python/detail/returning.hpp>
|
||||
# include <boost/mpl/select_type.hpp>
|
||||
# include <boost/mpl/select_if.hpp>
|
||||
# include <boost/type_traits/composite_traits.hpp>
|
||||
# include <boost/type_traits/same_traits.hpp>
|
||||
# include <boost/python/detail/preprocessor.hpp>
|
||||
# include <boost/mpl/aux_/preprocessor.hpp>
|
||||
# include <boost/preprocessor/comma_if.hpp>
|
||||
# include <boost/preprocessor/enum_params.hpp>
|
||||
|
||||
namespace boost { namespace python
|
||||
{
|
||||
@@ -30,33 +30,33 @@ struct caller
|
||||
# include <boost/python/preprocessed/caller.hpp>
|
||||
# endif
|
||||
|
||||
# define BOOST_PYTHON_CALLER_PF(args_, ignored) \
|
||||
template < \
|
||||
class P \
|
||||
, class R \
|
||||
BOOST_PP_COMMA_IF(args_) BOOST_MPL_TEMPLATE_PARAMETERS(0, args_, class A) \
|
||||
> \
|
||||
PyObject* operator()( \
|
||||
BOOST_PYTHON_FN(*f,0,args_) \
|
||||
, PyObject* args, PyObject* keywords \
|
||||
, P const& policies \
|
||||
) const \
|
||||
{ \
|
||||
return returning<R>::call(f, args, keywords,&policies); \
|
||||
# define BOOST_PYTHON_CALLER_PF(args_, ignored) \
|
||||
template < \
|
||||
class P \
|
||||
, class R \
|
||||
BOOST_PP_COMMA_IF(args_) BOOST_PP_ENUM_PARAMS(args_, class A) \
|
||||
> \
|
||||
PyObject* operator()( \
|
||||
BOOST_PYTHON_FN(*f,0,args_) \
|
||||
, PyObject* args, PyObject* keywords \
|
||||
, P const& policies \
|
||||
) const \
|
||||
{ \
|
||||
return returning<R>::call(f, args, keywords,&policies); \
|
||||
}
|
||||
|
||||
BOOST_PYTHON_REPEAT_ARITY_2ND(BOOST_PYTHON_CALLER_PF, nil)
|
||||
|
||||
// Member functions
|
||||
# define BOOST_PYTHON_CALLER_PMF(args_, cv) \
|
||||
template <class P, class R, BOOST_MPL_TEMPLATE_PARAMETERS(0, args_, class A)> \
|
||||
PyObject* operator()( \
|
||||
BOOST_PYTHON_FN(A0::*f,1,args_)cv() \
|
||||
, PyObject* args, PyObject* keywords \
|
||||
, P const& policies \
|
||||
) const \
|
||||
{ \
|
||||
return returning<R>::call(f, args, keywords,&policies); \
|
||||
# define BOOST_PYTHON_CALLER_PMF(args_, cv) \
|
||||
template <class P, class R, BOOST_PP_ENUM_PARAMS(args_, class A)> \
|
||||
PyObject* operator()( \
|
||||
BOOST_PYTHON_FN(A0::*f,1,args_)cv() \
|
||||
, PyObject* args, PyObject* keywords \
|
||||
, P const& policies \
|
||||
) const \
|
||||
{ \
|
||||
return returning<R>::call(f, args, keywords,&policies); \
|
||||
}
|
||||
|
||||
BOOST_PYTHON_REPEAT_MF_ALL_CV_2ND(BOOST_PYTHON_CALLER_PMF)
|
||||
|
||||
Reference in New Issue
Block a user