[C++-sig] vector<int> -> list

Stefan Seefeld seefeld at sympatico.ca
Wed Nov 15 02:26:01 CET 2006


Johan Johansson wrote:
> Dear list,
> 
> What would be the best way to return a rather largish vector of integers
> to Python from a C++ function? And while I'm at it, what would be the
> best way of iterating through a boost::python::list?

You may want to look at http://boost.org/libs/python/doc/v2/indexing.html
for the first. For the second, I believe the 'for a in [...]' style gives
as good a performance as you can get.

Regards,
		Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...



More information about the Cplusplus-sig mailing list