[C++-sig] automatic conversion of tuple to vector

Jim Bosch talljimbo at gmail.com
Tue May 25 10:06:28 CEST 2010

Hope I'm not thread-hijacking too much here, but this piqued my curiosity:

On 05/25/2010 12:06 AM, Michele De Stefano wrote:
> Nathan,
> if you want to take a boost::numeric::ublas::vector instead of
> std::vector, you can use my library (mds-utils, the link is at the end
> of this e-mail), which already provides the proper converters.

Do you handle the non-const reference case automatically?  More 
precisely, can you do:

void func(boost::numeric::ublas::vector & arg);
boost::python::def("func", func);

...pass it a python list, and find that list modified after the call?

I've been stumped by this problem in boost python before, and I had 
previously come the conclusion that it was impossible, so I'd be very 
interested to hear it if you have a solution.

Jim Bosch

More information about the Cplusplus-sig mailing list