Replies: 1 comment
-
Similar issue where either a pointer or NULL is returned by the C++ function, but the binding can't compile because NULL is seen as an int instead of a typed pointer. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
In NumPy, there is the function with this Python signature:
How can I implement this in C++ in PyBind11? It seems easy, but when I code it up, it gives the error in the subject.
Here is the code snippet. The code compiles and works perfectly if I comment out the
case 'd'
, or I comment out thecase 'f'
. However, it won't work if I include both.I am wondering if pybind11 is flexible enough to do this? Or would it require complicated internal changes to do so?
What I have tried so far:
py::object
andpy:buffer_info
. However, PyBind11 gives an error that it cannot convert the return type.Beta Was this translation helpful? Give feedback.
All reactions