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've come up with a solution using lambdas, but its sort of tedious since I have many 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 accomplish this with Boost.Python?
cogto generate the functions automatically for you (considering that the functions follows the same "template").