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
On my machine this input header results in the following generated Rust struct, which looks reasonable, except the Rust side and C++ side disagree about the size of std::string.
Per comments on #18 this is intentional because of this prelude without which bindgen can't cope with std::string at all (and, as you hint, different STLs could theoretically give different implementations so we probably can't make better assumptions - I must admit I have not checked the C++ standards though). I am going to treat this as a duplicate of #18, which remains in brief "field access to non-POD types is doomed"!!
Ah that's too bad. :( It would have been really slick to be able to support this without accessor methods. I have some ideas for how to make it work anyway without accessors and without requiring to know the field sizes at codegen time, which I will write up.
On my machine this input header results in the following generated Rust struct, which looks reasonable, except the Rust side and C++ side disagree about the size of std::string.
I'll share a PR to help reproduce. Possibly bindgen run by autocxx is finding a different set of system headers than the C++ build?
Here is the debug printing I used to confirm the issue:
Expected output is that C++ and Rust print the same size and the third line is 1, but the actual output is:
The text was updated successfully, but these errors were encountered: