-
This isn't an issue necessarily with Pybind11 but more of a C++ noobie's cry for help. I would like to be able to pass packed binary data from Python into C++ and then copy it into a basic struct. I tried reading through #2517 but just don't have a good enough understanding to get this to work. Python
C++
My binding function takes an argument
What am I missing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Okay, after a lot of head banging I figured this out. Instead of accepting a |
Beta Was this translation helpful? Give feedback.
Okay, after a lot of head banging I figured this out. Instead of accepting a
py::bytes
in my binding function, I'm usingstd::string
(ref). Usingstd::memcpy
to assign to my struct works as expected.