From 976b8180aeaec12e10fc2465736201ff63d8d321 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 14 Aug 2003 22:48:01 +0000 Subject: [PATCH] Workaround a VC7 bug with nested enums [SVN r19611] --- include/boost/python/object_core.hpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/include/boost/python/object_core.hpp b/include/boost/python/object_core.hpp index f9056055..aa7dfb31 100755 --- a/include/boost/python/object_core.hpp +++ b/include/boost/python/object_core.hpp @@ -27,12 +27,18 @@ # include # include -# include -# include +# include # include # include +# include +# include + +# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +# include +# endif + namespace boost { namespace python { namespace converter @@ -69,8 +75,6 @@ namespace api // BOOST_PYTHON_IS_XXX_DEF(proxy, boost::python::api::proxy, 1) - template struct object_initializer; - class object; typedef PyObject* (object::*bool_type)() const; @@ -224,11 +228,7 @@ namespace api BOOST_DEDUCED_TYPENAME unwrap_reference::type >::get( object::do_unforward(x) - , detail::convertible::check( - to_ptr( - object::do_unforward(x) - ) - ) + , is_convertible() )) { } @@ -236,8 +236,6 @@ namespace api // Throw error_already_set() if the handle is null. BOOST_PYTHON_DECL explicit object(handle<> const&); private: - template - static T const* to_ptr(T const&) { return 0; } template typename objects::unforward_cref::type do_unforward(T const& x) @@ -287,14 +285,14 @@ namespace api struct object_initializer_impl { static PyObject* - get(object const& x, detail::yes_convertible) + get(object const& x, mpl::true_) { return python::incref(x.ptr()); } template static PyObject* - get(T const& x, detail::no_convertible) + get(T const& x, mpl::false_) { return python::incref(converter::arg_to_python(x).get()); } @@ -305,7 +303,7 @@ namespace api { template static PyObject* - get(proxy const& x, detail::no_convertible) + get(proxy const& x, mpl::false_) { return python::incref(x.operator object().ptr()); }