[C++-sig] Shared Pointers and Boost.Python
Ralf W. Grosse-Kunstleve
rwgk at yahoo.com
Fri Jul 23 21:04:26 CEST 2004
--- Brian Hall <bhall at gamers-fix.com> wrote:
> BOOST_PYTHON_MODULE(GI_AISDK)
> {
> // Expose the State class to Python
> class_<A>("A");
> class_<B>("B", init<shared_ptr<A> >())
> .def("getA", &B::getA);
> }
Try:
class_<A, shared_ptr<A> >("A");
class_<B, shared_ptr<B> >("B", init<shared_ptr<A> >())
This should answer the first part of your question. I am not sure about the
second part.
Ralf
__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/
More information about the Cplusplus-sig
mailing list