mirror of
https://github.com/boostorg/python.git
synced 2026-01-28 07:22:31 +00:00
Changes for MPL v2
[SVN r13504]
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
# define CLASS_CONVERTERS_DWA2002119_HPP
|
||||
|
||||
# include <boost/python/object/class_wrapper.hpp>
|
||||
# include <boost/mpl/for_each.hpp>
|
||||
# include <boost/mpl/fold.hpp>
|
||||
# include <boost/python/reference.hpp>
|
||||
# include <boost/python/converter/registry.hpp>
|
||||
# include <boost/python/object/find_instance.hpp>
|
||||
@@ -44,8 +44,7 @@ struct do_nothing
|
||||
template <class Derived>
|
||||
struct register_base_of
|
||||
{
|
||||
// Ignored is needed because mpl::for_each is still actually
|
||||
// accumulate. We're not using any state so it just sits there.
|
||||
// We're not using any state so we supply Ingored argument
|
||||
template <class Ignored, class Base>
|
||||
struct apply
|
||||
{
|
||||
@@ -60,7 +59,7 @@ struct register_base_of
|
||||
register_conversion<Derived,Base>(false);
|
||||
|
||||
// Register the down-cast, if appropriate.
|
||||
mpl::select_type<
|
||||
mpl::select_if_c<
|
||||
is_polymorphic<Base>::value
|
||||
, register_downcast<Base,Derived>
|
||||
, do_nothing
|
||||
@@ -85,7 +84,7 @@ inline void register_class_from_python(Derived* = 0, Bases* = 0)
|
||||
register_dynamic_id<Derived>();
|
||||
|
||||
// register each base in the sequence
|
||||
mpl::for_each<Bases, void, register_base_of<Derived> >::execute();
|
||||
mpl::fold<Bases, void, register_base_of<Derived> >::execute();
|
||||
}
|
||||
|
||||
}}} // namespace boost::python::object
|
||||
|
||||
Reference in New Issue
Block a user