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
In rust #[repr(u8)] says a C-like enum's underlying type should be a u8. #[repr(C)] says it should have underlying type int (or whatever matches the dominant C ABI of the target platform).
In C++ this attribute could be lowered to an enum class with the following syntax:
enum class MyEnum: uint8_t { ... }
In C I'm not sure what the equivalent is -- possibly in the most extreme generating #defines. Although i vaguely recall hearing newer C's getting an equivalent of the C++ syntax here?
The text was updated successfully, but these errors were encountered:
In rust
#[repr(u8)]
says a C-like enum's underlying type should be a u8.#[repr(C)]
says it should have underlying typeint
(or whatever matches the dominant C ABI of the target platform).In C++ this attribute could be lowered to an enum class with the following syntax:
In C I'm not sure what the equivalent is -- possibly in the most extreme generating
#define
s. Although i vaguely recall hearing newer C's getting an equivalent of the C++ syntax here?The text was updated successfully, but these errors were encountered: