3 ms·
You could define flags as an enum with values 1, 2, 4, 8, ... and OR them together.
by bonzini 8y ago
You could define flags as an enum with values 1, 2, 4, 8, ... and OR them together.
- auscompgeek 8y agoSuch a scenario is more appropriately represented with the bitflags crate.
- bonzini 8y agoSure, he's talking about C and FFI though. You can use bitflags but you still need to convert at language boundaries.