Open petrasvestartas opened 1 year ago
This example passes a list by reference : https://github.com/tdegeus/pybind11_examples/blob/master/01_py-list_cpp-vector/example.cpp
Dear @tdegeus ,
By returning the output, doesn't it copy the data to a new vector?
Ah @petrasvestartas . Ah yeah you are right, I did not look further than the input as I assumed your question to be about that. What is your question then actually about:
const
from the input and remove the output. This could be a nice example to add indeed. It would be great if you could open a PR.std::vector<double>&
as return object. Same here, it could be nice to add on example.Or is your question about yet something else?
The second. I think the only way to do this is by using opaque option from pybind11.
Hi,
In your examples of std::vector, data is copied.
Is there any example that shows how to bind vectors by reference instead of copy?