[C++-sig] Re: Returning shared_ptr<boost::python::obj> to Python

Jim jmastro at rochester.rr.com
Sun Sep 5 04:37:37 CEST 2004


David Abrahams wrote:
> Sure.  But if you really have MyCPPObject instances (or instances of
> something derived from MyCPPObject in Python), it might be a good
> idea to stick with shared_ptr<MyCPPObject> instead... just FWIW.

Right now I don't, but I might eventually have a C++ base class for all my
Python objects of this type, so yeah, the shared_ptr may reappear here.

BTW, after getting rid of the shared_ptr<boost::python::object> business and
just using lists of object's, everything's up and running great again. I
didn't really say what I was doing in my post, but basically I got the
bright idea not too long ago that I was going to rewrite some tools of mine
in Python (using wxPython), which meant my game engine had to be wrapped up
with boost.python so the scripts could use it. It's worked out great so far.

-jim




More information about the Cplusplus-sig mailing list