Pass pointers as integers #92
Unanswered
MatthiasKohl
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Could you try this with the very latest version of nanobind, building on |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is similar to #11 but my issue is that the definition of the opaque type is incomplete when compiling the binding, so I just want to treat the pointer to the type as an integer, then
reinterpret_cast
it.This is fairly easy to solve since I can just do:
void foo(const uintptr_t& _ptr) { ptr = reinterpret_cast<const opaque_ptr&>(_ptr); // do something }
But I was wondering if this is the only way ? I'd prefer the
type_caster
approach because it makes the binding functions a bit cleaner, but nanobind wants me to cast the underlying type instead.Beta Was this translation helpful? Give feedback.
All reactions