On Tuesday 20 January 2009 04:27:02 Sebastian Walter wrote:
> Thanks for the hint :),
> Your code is a little to heavyweight for my purposes,
> but I learned quite a lot how boost::python converters work.
>
> And it also gave me the idea that finally solved my problem!

Good.

> // global to guarantee that the data is not freed after
> test_function_that_doesnt_copy returns
> double x[] = {1.,2.,3.};

In this case, you run into the problem of lifetime management. Unless you use 
globals, how do you guarantee that once all users of the array are done with 
it, the array is deleted? The array must be deleted from either the python 
side (via numpy) or from the C++ side (by yourself). Handling this problem is 
the cause for much of my code (which may still be too heavyweight for you).

Regards,
Ravi


_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to