Skip to content

Unpacking binary data in C++ #4290

Answered by jimmy-swa
jimmy-swa asked this question in Q&A
Oct 27, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Okay, after a lot of head banging I figured this out. Instead of accepting a py::bytes in my binding function, I'm using std::string (ref). Using std::memcpy to assign to my struct works as expected.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jagerman
Comment options

@jimmy-swa
Comment options

Answer selected by jimmy-swa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants