> > OK, so you've now got a view of the data from the valarray. Nice to know > this works, but, of course, fragile if the valarray is re-sized or > anything, so it probably won't work for us. >
Unless you use a special allocator/desallocator (I don't know if the latter is possible), I don't know how you could first correctly share the pointer (as you said, if the valarray is resized or deleted, you lose your memory). If you want to have a correct implementation (robust to array deletion, resizing in Python and C++), you should use shared pointers, and I don't know if you can build a vector with a shared pointer (perhaps with the special allocator/desallocator, but then it does not work with std::set, std::list or std::map). Matthieu
_______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
