How do I trampoline a unique_ptr reference in the smart_holder branch? #3204
Unanswered
daltairwalter
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The notes in the smart_holder branch seem to be very focused on unique_ptr, but I can't figure out how to use unique_ptr as an argument in a trampoline function. I would like to pass a reference to a unique_ptr to python. My C++ code still owns the object, but I want python to be able to access it for the duration of the python function. I can use .get(), but this loses the concept of unique_ptr and if python holds the pointer I see a crash later.
The smart_holder branch is working well for me otherwise, I have always had to hack pybind11 quite a bit for shared_ptr and shared_ptr seems to be working properly for me - also changing 9 projects over to use progressive mode only took about 20 minutes - this was a relatively painless transition.
Beta Was this translation helpful? Give feedback.
All reactions