I wrote:
> Robert wrote:
>> Will dereferencing a CppObject pointer always create a Python object
>> then? You could take the address of a CppObject and get a volitile
>> pointer (just as with bytes -> char*), right?
>
> &obj would be like bytes -> char*, same caveats
>
> ptr[0] would (in my proposal anyway) return a Python object; BUT if that
> is immedeately sent off to a C++ function by value it is just a
> middle-person that can be left out safely, as an optimization.

I think the right way to think about this is ptr[0] returning a C++
CppObject by value, but what then happens to it?

If it is coerced to object then obviously one is constructed, likewise if
it assigned a a Cython refcounted "cdef CppObject". But passing to C++
code would happen by value.

Dag Sverre

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to