2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-20 16:52:15 +00:00

Changes for MPL v2

[SVN r13504]
This commit is contained in:
Dave Abrahams
2002-04-16 14:29:30 +00:00
parent c0066c48ad
commit 74bd00489a
3 changed files with 20 additions and 12 deletions

View File

@@ -8,7 +8,7 @@
# include <boost/type_traits/cv_traits.hpp>
# include <boost/type_traits/composite_traits.hpp>
# include <boost/type_traits/function_traits.hpp>
# include <boost/mpl/select_type.hpp>
# include <boost/mpl/select_if.hpp>
namespace boost { namespace python { namespace detail {
@@ -150,7 +150,7 @@ typedef char (&outer_no_type)[1];
template <typename V>
struct is_const_help
{
typedef typename mpl::select_type<
typedef typename mpl::select_if_c<
is_const<V>::value
, inner_yes_type
, inner_no_type
@@ -160,7 +160,7 @@ struct is_const_help
template <typename V>
struct is_volatile_help
{
typedef typename mpl::select_type<
typedef typename mpl::select_if_c<
is_volatile<V>::value
, inner_yes_type
, inner_no_type
@@ -170,7 +170,7 @@ struct is_volatile_help
template <typename V>
struct is_pointer_help
{
typedef typename mpl::select_type<
typedef typename mpl::select_if_c<
is_pointer<V>::value
, inner_yes_type
, inner_no_type

View File

@@ -10,11 +10,13 @@
# include <boost/preprocessor/tuple/to_list.hpp>
# include <boost/preprocessor/tuple/elem.hpp>
# include <boost/preprocessor/list/for_each.hpp>
# include <boost/preprocessor/repeat_from_to.hpp>
# include <boost/preprocessor/repeat_from_to_2nd.hpp>
# include <boost/preprocessor/inc.hpp>
# include <boost/preprocessor/empty.hpp>
# include <boost/preprocessor/enum.hpp>
# include <boost/preprocessor/expr_if.hpp>
# include <boost/preprocessor/comma_if.hpp>
# include <boost/preprocessor/comparison/not_equal.hpp>
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

View File

@@ -6,7 +6,7 @@
#ifndef FORWARD_DWA20011215_HPP
# define FORWARD_DWA20011215_HPP
# include <boost/mpl/select_type.hpp>
# include <boost/mpl/select_if.hpp>
# include <boost/type_traits/object_traits.hpp>
# include <boost/type_traits/composite_traits.hpp>
# include <boost/type_traits/transform_traits.hpp>
@@ -30,7 +30,7 @@ struct reference_to_value
// is T.
template <class T>
struct forward
: mpl::select_type<
: mpl::select_if_c<
is_scalar<T>::value
, T
, reference_to_value<T> >