Boost.Python Multiple Return Arguments
I have a C ++ function that returns multiple values ββfrom its arguments.
void Do_Something( double input1, double input2, double input3,
double& output1, double& output2 )
{
...
output1 = something;
output2 = something;
}
I want to wrap this function using Boost.Python. I came up with a solution using lambdas, but it's kind of tedious since I have a lot of functions that have multiple return values ββin their arguments.
BOOST_PYTHON_MODULE( mymodule )
{
using boost::python;
def( "Do_Something", +[]( double input1, double input2, double input3 )
{
double output1;
double output2;
Do_Something( input1, input2, input3, output1, output2 );
return make_tuple( output1, output2 );
});
}
Is there a better \ automatic way to do this with Boost.Python?
+3
source to share