2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-28 19:32:14 +00:00

add proper default handling

[SVN r25017]
This commit is contained in:
Dave Abrahams
2004-09-11 14:53:05 +00:00
parent f7db275bc4
commit dc2acc5bf5
2 changed files with 18 additions and 3 deletions

View File

@@ -55,9 +55,11 @@ struct ACallback : A, wrapper<A>
#else
return f();
#endif
//else
return A::f();
return A::f();
}
char const* default_f() { return this->A::f(); }
};
struct B : A
@@ -124,7 +126,7 @@ A* pass_a(A* x) { return x; }
BOOST_PYTHON_MODULE_INIT(polymorphism2_ext)
{
class_<ACallback,boost::noncopyable>("A")
.def("f", &A::f)
.def("f", &A::f, &ACallback::default_f)
;
def("getBCppObj", getBCppObj, return_value_policy<reference_existing_object>());