Re: [C++-sig] express pointer ownership

2015-08-13 Thread Alex Mohr
On 8/13/2015 4:26 AM, MM wrote: What I want to express is: The t returned by the python function should refer to object T held in c++ memory, and for instance del t should not delete the actual T object in c++ memory Should I still use "return_internal_reference" ? You can use reference_ex

Re: [C++-sig] express pointer ownership

2015-08-13 Thread MM
On 13 August 2015 at 12:01, Stefan Seefeld wrote: > On 13/08/15 06:58 AM, MM wrote: > > On 13 August 2015 at 10:24, MM > > wrote: > > > > I have the following class: > > > > class T { > > }; > > // T has been exposed to python with class_ > > > >

Re: [C++-sig] express pointer ownership

2015-08-13 Thread Stefan Seefeld
On 13/08/15 06:58 AM, MM wrote: > On 13 August 2015 at 10:24, MM > wrote: > > I have the following class: > > class T { > }; > // T has been exposed to python with class_ > > and free function: > > void add_T( T* ); > > Ownership of the T* i

Re: [C++-sig] express pointer ownership

2015-08-13 Thread MM
On 13 August 2015 at 10:24, MM wrote: > I have the following class: > > class T { > }; > // T has been exposed to python with class_ > > and free function: > > void add_T( T* ); > > Ownership of the T* is taken by this C++ function. > > > If I create an instance of the python version of T, how do

[C++-sig] express pointer ownership

2015-08-13 Thread MM
I have the following class: class T { }; // T has been exposed to python with class_ and free function: void add_T( T* ); Ownership of the T* is taken by this C++ function. If I create an instance of the python version of T, how do I "def" the add_T function? def("add_T", add_T) fails to co