[C++-sig] convert child class to child class {lvalue} ?

Hans Meine meine at informatik.uni-hamburg.de
Thu Oct 11 13:01:12 CEST 2007


Am Mittwoch, 10. Oktober 2007 23:53:06 schrieb Steven Wyckoff:
> BOOST_PYTHON_MODULE(extending)
> {
> using namespace boost::python;
>
> class_<BaseWrap, boost::noncopyable>("baseobj")
> .def("ID", &baseobj::ID, &BaseWrap::ID, "Returns the ID of the object")
> .def("GetVal", &baseobj::GetVal)
> .def("SetVal", &baseobj::SetVal)
> ;
>
> class_<childobj, bases<BaseWrap> >("childobj")
> .def("ChildOnly", &childobj::ChildOnly)
> ;

I never used wrapper<>, but did you try bases<baseobj>?
I mean - childobj *is* derived from baseobj, not BaseWrap.

-- 
Ciao, /  /
     /--/
    /  / ANS



More information about the Cplusplus-sig mailing list