[C++-sig] Boost::Python: return a tuple?

Roman Yakovenko roman.yakovenko at gmail.com
Mon Jan 29 19:30:07 CET 2007


On 1/29/07, James Supancic <arrummzen at gmail.com> wrote:
> I'm trying to figure out how to make a function return a tuple, I've
> tried numerous different approaches but so far I can't get anything to
> work. I basically need to write a function that returns a tuple of
> three doubles say (1,2,3). How can I do this?
>
> A simple example is probably all I'll need.

boost::python::tuple get123(){
    return boost::python::make_tuple( 1,2,3);
}

docs: http://www.boost.org/libs/python/doc/v2/tuple.html

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list