mirror of
https://github.com/boostorg/python.git
synced 2026-01-26 18:52:26 +00:00
Support for wrapping function objects and classes which use virtual
inheritance. Completely killed off member_function_cast! [SVN r19945]
This commit is contained in:
@@ -25,6 +25,7 @@ struct P
|
||||
{
|
||||
virtual ~P(){}
|
||||
virtual std::string f() = 0;
|
||||
std::string g() { return "P::g()"; }
|
||||
};
|
||||
|
||||
struct PCallback : P, Callback
|
||||
@@ -37,7 +38,7 @@ struct PCallback : P, Callback
|
||||
}
|
||||
};
|
||||
|
||||
struct Q : P
|
||||
struct Q : virtual P
|
||||
{
|
||||
std::string f() { return "Q::f()"; }
|
||||
};
|
||||
@@ -155,6 +156,7 @@ BOOST_PYTHON_MODULE_INIT(polymorphism_ext)
|
||||
;
|
||||
|
||||
class_<Q, bases<P> >("Q")
|
||||
.def("g", &P::g) // make sure virtual inheritance doesn't interfere
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user