From 23769371bc8bd2baa16c6fb5ef14f37ad18cb05d Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 11 Mar 2002 18:57:45 +0000 Subject: [PATCH] Elimination of boost/python/detail/eval.hpp; using mpl::apply instead [SVN r13176] --- include/boost/python/detail/caller.hpp | 1 - include/boost/python/detail/eval.hpp | 40 ------------ include/boost/python/detail/returning.hpp | 63 ++++++++++--------- include/boost/python/object/make_holder.hpp | 16 ++--- .../boost/python/object/pointer_holder.hpp | 6 +- 5 files changed, 43 insertions(+), 83 deletions(-) delete mode 100644 include/boost/python/detail/eval.hpp diff --git a/include/boost/python/detail/caller.hpp b/include/boost/python/detail/caller.hpp index d0b01b6e..68da40e6 100644 --- a/include/boost/python/detail/caller.hpp +++ b/include/boost/python/detail/caller.hpp @@ -7,7 +7,6 @@ # define CALLER_DWA20011214_HPP # include -# include # include # include # include diff --git a/include/boost/python/detail/eval.hpp b/include/boost/python/detail/eval.hpp deleted file mode 100644 index 8699f701..00000000 --- a/include/boost/python/detail/eval.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright David Abrahams 2002. Permission to copy, use, -// modify, sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. -#ifndef EVAL_DWA2002124_HPP -# define EVAL_DWA2002124_HPP - -# include - -namespace boost { namespace python { namespace detail { - -template struct undefined; -template -struct eval -{ -# if defined(BOOST_MSVC) && BOOST_MSVC <= 1200 - // based on the (non-conforming) MSVC trick from MPL - template - struct unarymetafunction_vc : UnaryMetaFunction {}; - - // illegal C++ which causes VC to admit that unarymetafunction_vc - // can have a nested template: - template<> - struct unarymetafunction_vc - { - template struct apply; - }; - - typedef typename unarymetafunction_vc< - ::boost::mpl::detail::msvc_never_true::value - >::template apply::type type; -# else - typedef typename UnaryMetaFunction::template apply::type type; -# endif -}; - -}}} // namespace boost::python::detail - -#endif // EVAL_DWA2002124_HPP diff --git a/include/boost/python/detail/returning.hpp b/include/boost/python/detail/returning.hpp index d7e98cd8..2c5d8c4f 100644 --- a/include/boost/python/detail/returning.hpp +++ b/include/boost/python/detail/returning.hpp @@ -15,6 +15,7 @@ # include # include # include +# include namespace boost { namespace python { namespace detail { @@ -31,7 +32,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -52,7 +53,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -75,7 +76,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -101,7 +102,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -130,7 +131,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -162,7 +163,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -186,7 +187,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -207,7 +208,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -230,7 +231,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -256,7 +257,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -285,7 +286,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -317,7 +318,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -341,7 +342,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -362,7 +363,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -385,7 +386,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -411,7 +412,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -440,7 +441,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -472,7 +473,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -499,7 +500,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -520,7 +521,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -543,7 +544,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -569,7 +570,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -598,7 +599,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -630,7 +631,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -652,7 +653,7 @@ struct returning { // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -671,7 +672,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -692,7 +693,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -716,7 +717,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -743,7 +744,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -773,7 +774,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; @@ -806,7 +807,7 @@ struct returning // find the result converter typedef typename P::result_converter result_converter; - typename eval::type cr; + typename mpl::apply1::type cr; if (!cr.convertible()) return 0; if (!policies.precall(args_)) return 0; diff --git a/include/boost/python/object/make_holder.hpp b/include/boost/python/object/make_holder.hpp index 1ba6f932..871ed059 100644 --- a/include/boost/python/object/make_holder.hpp +++ b/include/boost/python/object/make_holder.hpp @@ -10,7 +10,7 @@ # include # include # include -# include +# include namespace boost { namespace python { namespace objects { @@ -22,7 +22,7 @@ struct make_holder<0> template struct apply { - typedef typename python::detail::eval::type holder; + typedef typename mpl::apply1::type holder; static void execute( PyObject* p) { @@ -38,7 +38,7 @@ struct make_holder<1> template struct apply { - typedef typename python::detail::eval::type holder; + typedef typename mpl::apply1::type holder; typedef typename mpl::at<0,ArgList>::type t0; typedef typename forward::type f0; @@ -57,7 +57,7 @@ struct make_holder<2> template struct apply { - typedef typename python::detail::eval::type holder; + typedef typename mpl::apply1::type holder; typedef typename mpl::at<0,ArgList>::type t0; typedef typename forward::type f0; typedef typename mpl::at<1,ArgList>::type t1; @@ -77,7 +77,7 @@ struct make_holder<3> template struct apply { - typedef typename python::detail::eval::type holder; + typedef typename mpl::apply1::type holder; typedef typename mpl::at<0,ArgList>::type t0; typedef typename forward::type f0; typedef typename mpl::at<1,ArgList>::type t1; @@ -99,7 +99,7 @@ struct make_holder<4> template struct apply { - typedef typename python::detail::eval::type holder; + typedef typename mpl::apply1::type holder; typedef typename mpl::at<0,ArgList>::type t0; typedef typename forward::type f0; typedef typename mpl::at<1,ArgList>::type t1; @@ -123,7 +123,7 @@ struct make_holder<5> template struct apply { - typedef typename python::detail::eval::type holder; + typedef typename mpl::apply1::type holder; typedef typename mpl::at<0,ArgList>::type t0; typedef typename forward::type f0; typedef typename mpl::at<1,ArgList>::type t1; @@ -149,7 +149,7 @@ struct make_holder<6> template struct apply { - typedef typename python::detail::eval::type holder; + typedef typename mpl::apply1::type holder; typedef typename mpl::at<0,ArgList>::type t0; typedef typename forward::type f0; typedef typename mpl::at<1,ArgList>::type t1; diff --git a/include/boost/python/object/pointer_holder.hpp b/include/boost/python/object/pointer_holder.hpp index 2722ae85..57cb6b47 100644 --- a/include/boost/python/object/pointer_holder.hpp +++ b/include/boost/python/object/pointer_holder.hpp @@ -9,10 +9,10 @@ # include # include # include -# include # include # include # include +# include namespace boost { namespace python { namespace objects { @@ -306,7 +306,7 @@ namespace detail template struct apply { - typedef typename boost::python::detail::eval< + typedef typename mpl::apply1< PointerGenerator,BackReferenceType >::type pointer; @@ -320,7 +320,7 @@ namespace detail template struct apply { - typedef typename boost::python::detail::eval< + typedef typename mpl::apply1< PointerGenerator,Held >::type pointer;