From 74bd00489a602ccb9cdee40bb08525889ae7019f Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 16 Apr 2002 14:29:30 +0000 Subject: [PATCH] Changes for MPL v2 [SVN r13504] --- .../boost/python/detail/indirect_traits.hpp | 8 ++++---- include/boost/python/detail/preprocessor.hpp | 20 +++++++++++++------ include/boost/python/object/forward.hpp | 4 ++-- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/include/boost/python/detail/indirect_traits.hpp b/include/boost/python/detail/indirect_traits.hpp index a3e67dd3..b19408fc 100644 --- a/include/boost/python/detail/indirect_traits.hpp +++ b/include/boost/python/detail/indirect_traits.hpp @@ -8,7 +8,7 @@ # include # include # include -# include +# include namespace boost { namespace python { namespace detail { @@ -150,7 +150,7 @@ typedef char (&outer_no_type)[1]; template struct is_const_help { - typedef typename mpl::select_type< + typedef typename mpl::select_if_c< is_const::value , inner_yes_type , inner_no_type @@ -160,7 +160,7 @@ struct is_const_help template struct is_volatile_help { - typedef typename mpl::select_type< + typedef typename mpl::select_if_c< is_volatile::value , inner_yes_type , inner_no_type @@ -170,7 +170,7 @@ struct is_volatile_help template struct is_pointer_help { - typedef typename mpl::select_type< + typedef typename mpl::select_if_c< is_pointer::value , inner_yes_type , inner_no_type diff --git a/include/boost/python/detail/preprocessor.hpp b/include/boost/python/detail/preprocessor.hpp index 510e0755..3945fdaf 100644 --- a/include/boost/python/detail/preprocessor.hpp +++ b/include/boost/python/detail/preprocessor.hpp @@ -10,11 +10,13 @@ # include # include # include +# include # include # include # include # include -# include +# include +# include namespace boost { namespace python { namespace detail { @@ -63,8 +65,17 @@ namespace boost { namespace python { namespace detail { # define BOOST_PYTHON_MF_ARITY_FINISH BOOST_PP_INC(BOOST_PYTHON_MAX_ARITY) #endif -# define BOOST_PYTHON_FN(inner,start,count) \ - R(inner)(BOOST_MPL_TEMPLATE_PARAMETERS(start,count,A)) +# define BOOST_PYTHON_PROJECT_1ST(a1,a2) a1 +# define BOOST_PYTHON_PROJECT_2ND(a1,a2) a2 + +# define BOOST_PYTHON_APPEND_PARAM_INDEX(index, param_start_pair) \ + BOOST_PP_COMMA_IF( \ + BOOST_PP_NOT_EQUAL(index, BOOST_PYTHON_PROJECT_2ND param_start_pair)) \ + BOOST_PP_CAT(BOOST_PYTHON_PROJECT_1ST param_start_pair,index) + +# define BOOST_PYTHON_FN(inner,start,count) \ + R(inner)(BOOST_PP_REPEAT_FROM_TO( \ + start,count,BOOST_PYTHON_APPEND_PARAM_INDEX,(A,start))) # define BOOST_PYTHON_REPEAT_ARITY_2ND(function,data) \ BOOST_PP_REPEAT_FROM_TO_2ND( \ @@ -91,9 +102,6 @@ namespace boost { namespace python { namespace detail { #define BOOST_PYTHON_ENUM_PARAMS2(N, Pair) BOOST_PP_ENUM(N, BOOST_PYTHON_NUMBER_PAIR, Pair) -# define BOOST_PYTHON_PROJECT_1ST(a1,a2) a1 -# define BOOST_PYTHON_PROJECT_2ND(a1,a2) a2 - }}} // namespace boost::python::detail #endif // PREPROCESSOR_DWA200247_HPP diff --git a/include/boost/python/object/forward.hpp b/include/boost/python/object/forward.hpp index acae1173..1ce27e15 100644 --- a/include/boost/python/object/forward.hpp +++ b/include/boost/python/object/forward.hpp @@ -6,7 +6,7 @@ #ifndef FORWARD_DWA20011215_HPP # define FORWARD_DWA20011215_HPP -# include +# include # include # include # include @@ -30,7 +30,7 @@ struct reference_to_value // is T. template struct forward - : mpl::select_type< + : mpl::select_if_c< is_scalar::value , T , reference_to_value >