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
I have implemented a quadtree as linked set of nodes. I wrote a callback function that is supposed to be called on a node(which has unique_ptr<> for the children, and is therefore not copy-able). Thus I cannot use the callback function because it tries to copy the node before passing to the Python function (which makes sense), but it can't do that because the unique_ptr cannot be copied. I think we somehow need a similar semantics as nb::rv_policy::reference to handle this use-case, or an alternative solution is requested. In the end I had to implement the recursive walking of the tree on the Python-side, which was ok, but clunky.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have implemented a quadtree as linked set of nodes. I wrote a callback function that is supposed to be called on a node(which has
unique_ptr<>
for the children, and is therefore not copy-able). Thus I cannot use the callback function because it tries to copy the node before passing to the Python function (which makes sense), but it can't do that because theunique_ptr
cannot be copied. I think we somehow need a similar semantics asnb::rv_policy::reference
to handle this use-case, or an alternative solution is requested. In the end I had to implement the recursive walking of the tree on the Python-side, which was ok, but clunky.Beta Was this translation helpful? Give feedback.
All reactions