[C++-sig] Py++: auto_ptr held_type

Roman Yakovenko roman.yakovenko at gmail.com
Wed Jun 13 10:33:39 CEST 2007


On 6/12/07, Anand, Kumar <kanand at qualcomm.com> wrote:
> I am trying to expose a "MyTestClass" to python using py++ and with
> held_type as std::auto_ptr.
>
> Since Py++ creates a wrapper class for every C++ class that it exposes,

This is not completely true, also Py++ always provides an explanation
why it does this.

> should held_type be "std::auto_ptr<MyTestClass>" or
> "std::auto_ptr<MyTestClass_Wrapper>"?
>
> Can you point as to why one would choose one against the other?

Py++ has transfer_ownership_tester.py. You welcome to play with it.
I don't completely understand the issues related to
boost::python::wrapper class and auto_ptr as held_type. I found that
the whole mechanism doesn't work as expected.

For me std::auto_ptr<MyTestClass_Wrapper> worked fine.

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list