Change builtin type caster: const char*
to bytes
#1104
Unanswered
legendre6891
asked this question in
Q&A
Replies: 1 comment
-
It seems like I could use this to achieve my goal: -int f(const char* buf) {
+int f(nb::bytes buf) { This seems to rely on wrappers instead of type-casters. I'm curious if this is the recommended solution? (Is there a way to do this which just uses type casters?) |
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.
-
In this setup, the function
f
uses the type casterstr
toconst char*
.This means that it is not possible to call
f
with abytes
object:The association from
const char*
seems to be hardcoded innb_cast.h
. I'm curious if there is a way to override this? Namely, the binding function takesbytes
as input instead ofstr
?Beta Was this translation helpful? Give feedback.
All reactions