I have a C++ class containing void functions which take STL vectors passed by reference and modify the contents of one of those vectors. For example:
void somefunction(std::vector<double> &result, std::vector<double> &array1, std::vector<double> &array2) {some calculations}
And the pybind11 binding looks like this:
.def("somefunction", &somefunction)
I have included the 'pybind11/stl.h' header file which handles the automatic conversion between STL containers and python equivalents and in Python I call somefunction with Python lists but I'm not sure if the C++ layer can modify the result Python list.
My then question is how to write Python
bindings for C++ functions which modify the contents of an STL vector passed by reference and return void.