When a function uses T* (or T & ) as a parameter, this function will usually want to modify the object it pointed to, e.g.
ErrorCode GetValue(int * v);
ErrorCode GetValue(std::vector<int> * vec);
However:
- Python itself does not support mutable int
- pybind11 will create a copy when
T is a std container type, any modification to the copied object will not return to python runtime.
These cases should be handled automatically, or at least a warning should be printed.
When a function uses
T*(orT &) as a parameter, this function will usually want to modify the object it pointed to, e.g.However:
Tis a std container type, any modification to the copied object will not return to python runtime.These cases should be handled automatically, or at least a warning should be printed.