Replies: 1 comment 4 replies
-
In principle, a custom return value policy could be routed there. But how should nanobind expose this? I haven't bee able to find a good solution, external ideas/suggestions/PRs are welcomed. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The default
rv_policy
forstd::function
parameters isrv_policy::automatic_reference
. This results in an runtime error when the following code is executed:C++
Python
While this can be fixed by changing the
std::function
parameter list fromNonCopyable&
toNonCopyable*
, it can be still an issue when binding to other code which can't be easily changed. So my question is, if there is any way to change the return value policy when calling anstd::function
Beta Was this translation helpful? Give feedback.
All reactions