2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 06:02:14 +00:00

Workarounds for vc6 and 7.

[SVN r28958]
This commit is contained in:
Dave Abrahams
2005-05-16 14:54:12 +00:00
parent 82563df3bf
commit 13b16f9729
2 changed files with 23 additions and 38 deletions

View File

@@ -148,8 +148,9 @@ struct back_reference_arg_from_python
template <class C, class T, class F>
struct if_2
: mpl::eval_if<C, mpl::identity<T>, F>
{};
{
typedef typename mpl::eval_if<C, mpl::identity<T>, F>::type type;
};
// This metafunction selects the appropriate arg_from_python converter
// type for an argument of type T.
@@ -176,18 +177,18 @@ struct select_arg_from_python
mpl::or_<
indirect_traits::is_reference_to_non_const<T>
, indirect_traits::is_reference_to_volatile<T>
>
, reference_arg_from_python<T>
, mpl::if_<
boost::python::is_back_reference<T>
, back_reference_arg_from_python<T>
, arg_rvalue_from_python<T>
>
>
>
>
>
>::type type;
>
, reference_arg_from_python<T>
, mpl::if_<
boost::python::is_back_reference<T>
, back_reference_arg_from_python<T>
, arg_rvalue_from_python<T>
>
>
>
>
>
>::type type;
};
// ==================

View File

@@ -10,7 +10,6 @@
# include <boost/type_traits/transform_traits.hpp>
# include <boost/type_traits/cv_traits.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/type.hpp>
namespace boost {
@@ -59,49 +58,34 @@ struct registered<T&>
namespace detail
{
inline void
register_shared_ptr(...)
register_shared_ptr0(...)
{
}
template <class T>
inline void
register_shared_ptr(type<shared_ptr<T> >)
register_shared_ptr0(shared_ptr<T>*)
{
registry::lookup_shared_ptr(type_id<shared_ptr<T> >());
}
template <class T>
inline void
register_shared_ptr(type<shared_ptr<T> const>)
register_shared_ptr1(T const volatile*)
{
detail::register_shared_ptr(type<shared_ptr<T> >());
}
template <class T>
inline void
register_shared_ptr(type<shared_ptr<T> volatile>)
{
detail::register_shared_ptr(type<shared_ptr<T> >());
}
template <class T>
inline void
register_shared_ptr(type<shared_ptr<T> const volatile>)
{
detail::register_shared_ptr(type<shared_ptr<T> >());
detail::register_shared_ptr0((T*)0);
}
template <class T>
registration const&
registry_lookup(type<T&>)
registry_lookup(T&(*)())
{
detail::register_shared_ptr(type<T>());
detail::register_shared_ptr1((T*)0);
return registry::lookup(type_id<T>());
}
template <class T>
registration const& registered_base<T>::converters
= detail::registry_lookup(type<T>());
registration const& registered_base<T>::converters = detail::registry_lookup((T(*)())0);
}
}}} // namespace boost::python::converter