cxx
cxx copied to clipboard
Documentation needs to mention that enums in "extern C++" need to be `uint8_t`
Today I kept hitting the error where my enum's were the wrong size. This was fixed by changing the C++ side from
enum class Something { First, Second };
to
enum class Something : uint8_t { First, Second };
As far as I can tell, the documentation does not mention this. Perhaps it should?
Another option is #[repr(u32)]
at the Rust side.