only if it should be visible.
Why waste 64bit on if its visible or not instead of 16?
typedef struct widget{ union { struct { int visible:1; ... }; unsigned property; }; ... }widget_t; widget_t button={ .visible = TRUE };
You would probably want to put a type for “visible”
On C++ probably use getter/setter
Actually you can just use std::bitset
anoymous structs :) i like these especially as they provide you access via subscriting and dot operators
when change visibily you not only Need to set One bits
std::bitset still works
Обсуждают сегодня