You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that even if we write the appropriate MappedType, the generated code that call the method with a std::unique_ptr argument should std::move this one
Ideally the conversion from python -> C++ would also check that the object IS owned by python first, and if not then raise some kind of Python exception (RuntimeError?) stating that it's not possible to call the method with an object which isn't owned by python.
(Otherwise we'll eventually get a double free crash somewhere)
Adding a /Movable/ (or similar - /NonCopyable/?) mapped type annotation shouldn't be too much of a problem.
I don't see a problem with ownership so long as /Transfer/ is used properly. It may be possible that mapped type conversion code doesn't currently have enough context to handle transfers of ownership properly in this case.
Can I assume that the common use case is going to be when unique_ptrs are going to be passed and returned by value?
It's not possible to use std::unique_ptr as arguments. It works as returned value only.
Here is an example unique_ptr.zip
The problem is that even if we write the appropriate MappedType, the generated code that call the method with a std::unique_ptr argument should std::move this one
Could it be supported by SIP ?
The text was updated successfully, but these errors were encountered: